public static boolean containsLogFiles ( File location ) { if ( location == null ) { return false ; } location = checkKnownType ( location ) ; if ( isFile ( location ) ) { try { // Is a WBL file. if ( new OneFileBrowserImpl ( location ) . getProcessId ( ) != null ) { return true ; } } catch ( IllegalArgumentException ex ) { // Fall through, can't use as a WBL file. } return false ; } if ( location . isDirectory ( ) ) { // Contains WBL files. LogRepositoryBrowserImpl browser = new LogRepositoryBrowserImpl ( location , new String [ ] { location . getName ( ) } ) ; if ( browser . findNext ( ( File ) null , - 1 ) != null ) { return true ; } // Its directories contain WBL files File [ ] wblDirs = location . listFiles ( new FileFilter ( ) { @ Override public boolean accept ( File pathname ) { return pathname . isDirectory ( ) && new LogRepositoryBrowserImpl ( pathname , new String [ ] { pathname . getName ( ) } ) . findNext ( ( File ) null , - 1 ) != null ; } } ) ; if ( wblDirs . length > 0 ) { return true ; } } for ( File file : new File [ ] { location , getChild ( location , LogRepositoryBrowserImpl . DEFAULT_LOCATION ) , getChild ( location , LogRepositoryBrowserImpl . TRACE_LOCATION ) } ) { // Contains Instance directories if ( file . isDirectory ( ) ) { MainLogRepositoryBrowserImpl fileBrowser = new MainLogRepositoryBrowserImpl ( file ) ; if ( fileBrowser . findByMillis ( - 1 ) != null ) { return true ; } } } return false ; }
checks if specified location contains log files .