List of utility methods to do Is File Name Valid
boolean | isValidFileName(final String aFileName) is Valid File Name final File aFile = new File(aFileName); boolean isValid = true; try { if (aFile.createNewFile()) { aFile.delete(); } catch (IOException e) { isValid = false; ... |
boolean | isValidFileName(String fileName) This method checks if a String represents a valid File name. File f = new File(fileName); try { f.getCanonicalPath(); return true; } catch (IOException e) { return false; |
boolean | isValidFileName(String fileName) is Valid File Name if (fileName == null || fileName.length() == 0) { return false; for (char c : ILLEGAL_CHARACTERS) { if (fileName.indexOf(c) != -1) { return false; File f = new File(fileName); try { f.getCanonicalPath(); return true; } catch (IOException e) { return false; |
boolean | isValidFileName(String input) is Valid File Name return ((null != input) && (-1 == input.indexOf(File.pathSeparator)));
|
boolean | isValidFileName(String paramString) is Valid File Name boolean rtn = false; if (paramString != null) { File localFile = new File(paramString); try { if (localFile.getCanonicalPath() != null) { rtn = true; } catch (IOException ex) { ... |
boolean | isValidFilePath(String filePath) Checks is file path is valid if (isNullOrEmpty(filePath)) { return false; String path = filePath.trim(); File file = new File(path); if ((!file.exists()) || file.isDirectory()) { return false; } else { ... |