/** * <p>Check whether the given file meet the required conditions (supported by the library OR directory). * The File must also be readable and not hidden.</p> * * @param f The file to test * @return a boolean indicating if the file is accepted or not */ public boolean accept(File f) { if (f.isHidden() || !f.canRead()) { return false; } if (f.isDirectory()) { return allowDirectories; } String ext = Utils.getExtension(f); try { if (SupportedFileFormat.valueOf(ext.toUpperCase()) != null) { return true; } } catch (IllegalArgumentException iae) { //Not known enum value return false; } return false; } }
if (SupportedFileFormat.valueOf(ext.toUpperCase()) != null)
if (SupportedFileFormat.valueOf(ext.toUpperCase()) != null)