private static File getDirectoryIfExists ( final File existingCandidate , final String path ) { if ( existingCandidate != null ) { return existingCandidate ; } if ( ! Strings . isNullOrEmpty ( path ) ) { final File directory = new File ( path ) ; if ( directory . exists ( ) && directory . isDirectory ( ) ) { return directory ; } } return null ; }
Gets a candidate directory based on a file path if it exists and if it another candidate hasn t already been resolved .