Good Morning in my timezone.
I have the following code:
Iterator<File> files = FileUtils.iterateFiles(new File(directoryPath), new String[]{"java"}, true);
for(String file : ws){
while(files.hasNext()){
current = files.next();
if(!current.isDirectory()){
if(current.getName().matches(file+".*ServiceProxy.*")){
//I need to start the cycle again from the beginning to search in each
//file for the ServiceProxy string
//Something like this
// cloneFiles = files.clone();
//while(cloneFiles.hasNext()){
file = files.next();
//search inside the file code
}
}
}
}
}
I want to clone the Iterator because this action is very expensive in terms of time
FileUtils.iterateFiles(new File(directoryPath), new String[]{"java"}, true);
Thanks in advance Best regards