Oracle Community Directory
Oracle Community FAQ
My Oracle Support Community (MOSC)
Go Directly To
Oracle Technology Network Community
My Oracle Support Community
OPN Cloud Connection
Oracle Employee Community
Oracle User Group Community
Conventional & Interruptable IO [ARCHIVE]
Please enter a title.
You can not post a blank message. Please type your message and try again.
This discussion is archived
: Feb 21, 2013 8:44 PM by
Order of the File.listFiles()
Feb 21, 2013 8:20 PM
We have the following code in our application, every thing was working fine until we upgraded our server infrastructure to VMWare 5.
Once our server were moved to VMWare 5, the order of the files in "allFiles" changed which is resulting in failure in the code that follows this.
*File baseFolder = new File(folderName);
File allFiles = baseFolder.listFiles(new JARFilter());
JarFile jarfile = null;
for(int i=0; i<allFiles.length; ++i)
System.out.println("The class File found in " + allFiles
I agree that we shouldn't have written our code in such a way that it would depend on the order of the files in the "allFiles", that is a very bad code, but what is done is done :(
We are in to production now and we can't even change the code, is there any way we can do to resolve this may a JVM args that would change the order or some thing on the OS level.
This content has been marked as final.
Show 1 reply
Re: Order of the File.listFiles()
Feb 21, 2013 8:44 PM
in response to
Java isn't doing this to you, the operating system, file system, maybe VMWare, is. You won't find a solution at the Java end. You'll have to fix your code or undo the VMWare upgrade.