I have the following code in java I would need to search the result returned the name of a specific file, the problem is that this way I search by extension and not by the name and I can not think of how to perform a search by name . I hope you can help me.
public static void main(String[] args)
{
// Aquí la carpeta que queremos explorar
String path = "C://Users//Federico//Downloads";
String files = null;
File folder = new File(path);
File[] listOfFiles = folder.listFiles();
for (int i = 0; i < listOfFiles.length; i++) {
if (listOfFiles[i].isFile()) {
files = listOfFiles[i].getName();
if (files.endsWith(".seq") || files.endsWith(".SEQ")){
System.out.println(files);
}
}
}String s = files;
s.charAt(60);
for (int x = 0; x < s.length(); x++) {
System.out.println(s);
}
}
}