List of utility methods to do File Exist
boolean | isFileExist(String fileNameAndPath) is File Exist if (!isFileExistNotCreate(fileNameAndPath)) { createFolders(fileNameAndPath.replace(File.separator + getFileName(fileNameAndPath), "")); return newFile(fileNameAndPath, ""); return true; |
boolean | isFileExist(String filePath) is File Exist return new File(filePath).exists(); |
boolean | isFileExist(String filePath) determin if file exist. File file = new File(filePath); return file.exists(); |
boolean | isFileExist(String path) is File Exist if (isNullorEmpty(path)) { return false; File file = new File(path); if (file.isDirectory() || !file.exists()) { return false; } else { return true; ... |
boolean | isFileExist(String sFileName) File exist check boolean result = false; try { File f = new File(sFileName); if (f.exists() && f.isFile()) { result = true; } else { result = false; } catch (Exception e) { result = false; return result; |
boolean | isFileExistByRegex(String dir, final String regex) Check if has the files match the regulation expression under the given dir. if (regex == null) { return false; File file = new File(dir); if (!file.isDirectory()) { return file.exists(); String[] str = getFileListByRegex(dir, regex); ... |
boolean | isFileExisted(String filePathname) is File Existed boolean existed; try { File f = new File(filePathname); existed = f.isFile(); } catch (Exception e) { existed = false; return existed; ... |
boolean | isFileExistent(String path) is File Existent synchronized (path.intern()) { File file = new File(path); return file.exists(); |
boolean | isFileExistNotCreate(String fileNameAndPath) check if the specified file exists return new File(fileNameAndPath).isFile(); |
File | isFileExists(String f, String ext) is File Exists return isFileExists(new File(f), ext); |