public static File [ ] findJournalFiles ( String baseName , File dataFolder ) { final String journalBase = baseName + JournalFile . SUFFIX ; File [ ] journalFiles = dataFolder . listFiles ( new FileFilter ( ) { /* * (non-Javadoc) * @see java.io.FileFilter#accept(java.io.File) */ @ Override public boolean accept ( File pathname ) { if ( ! pathname . isFile ( ) ) return false ; return pathname . getName ( ) . startsWith ( journalBase ) && ! pathname . getName ( ) . endsWith ( JournalFile . RECYCLED_SUFFIX ) ; } } ) ; // Sort them in ascending order Arrays . sort ( journalFiles , new Comparator < File > ( ) { @ Override public int compare ( File f1 , File f2 ) { return f1 . getName ( ) . compareTo ( f2 . getName ( ) ) ; } } ) ; return journalFiles ; }
Find existing journal files for a given base name