List of utility methods to do File Exist
boolean | fileExists(String name) return true if the specified file (or Directory) exists either on a network or a local server. try { if (name.indexOf("://") != -1) { return true; } else { File f = new File(name); return f.exists(); } catch (Exception io) { ... |
boolean | fileExists(String parentDirectory, String filename) Determines if the file at the named location exists return new File(parentDirectory + File.separator + filename).exists(); |
boolean | fileExists(String path) file Exists return new File(path).exists(); |
boolean | fileExists(String path) file Exists if (path == null) { return false; } else { File file = new File(path); return file.exists(); |
boolean | fileExists(String path) Determine whether file exists at specified path File check = new File(path); try { return check.exists(); } catch (SecurityException se) { return false; |
boolean | fileExists(String path) Checks to see if the file or directory specified in the path actually exists if (path.length() > 0) { if ((new File(path)).exists()) { return true; } else { return false; } else { return false; ... |
boolean | fileExists(String path) file Exists try { File f = new File(path); return f.exists() && f.isFile(); } catch (Exception e) { throw new RuntimeException("Checking if file exists failed", e); |
boolean | fileExists(String path, boolean throwException) file Exists return fileExists(new File(path), throwException); |
boolean | fileExists(String path, String fileName) file Exists File file = new File(path, fileName); return file.exists(); |
boolean | fileExists(String s) file Exists if (s != null) { File f = toFile(s); return f.exists(); } else { return false; |