I'm trying to use Apache Commons IO FileFilters, and it's obvious I don't clearly understand them, because I can't get them to work trying to find a subdirectory.
Here's my code: File configCellDir = new File( FilenameUtils.concat( wasProfile , "config/cells" ) ) ; IOFileFilter dmgrFilter = FileFilterUtils.nameFileFilter( "dmgr" ) ; Collection dmgrDirs = FileUtils.listFiles( configCellDir , dmgrFilter , TrueFileFilter.INSTANCE ) ; I'm trying to find a subdirectory 'dmgr' anywhere in the <WAS_PROFILE>/config/cells filesystem. The directory is definitely there, but the dmgrDirs collection is empty. I've also tried: WildcardFileFilter dmgrFilter = new WildcardFileFilter( "*dmgr*" ) ; and: RegexFileFilter dmgrFilter = new RegexFileFilter( ".*dmgr.*" ) ; All without success. However, if I try to find a file, it works. IOFileFilter serverIndexFilter = FileFilterUtils.nameFileFilter( "serverindex.xml" ) ; Collection serverIndexFiles = FileUtils.listFiles( configCellDir , serverIndexFilter , TrueFileFilter.INSTANCE ) ; Can anyone tell me what I'm doing wrong? Thanks! DLW
