I need to sort files based on their name and extension. I use apache commons-io RegexFileFilter for that. The filename pattern is something like this: "filename.xml.20130101200" or "filename.xml.20130101200.inprog", where numbers are simple timestamp.
FileFilter regexFilter = new RegexFileFilter( ".*\\d{12}|.*inprog" );
File[] suitableFiles = dir.listFiles( regexFilter );
If this directory that contains those files is in my home dir "/home/user/files" then everything works fine when running with jboss. But when I change folder to "/tmp/files/" then filter will find files with ".inprog" extension. When i log the number of files in dir, it shows correct amount. I wrote simple main program for testing and everything works fine there, even if files are in /tmp/files. Jboss lives in my home folder.
What could be the problem?