/** * Returns the absolute path of this file. An absolute path is a path that starts at a root * of the file system. On Android, there is only one root: {@code /}. * * <p>A common use for absolute paths is when passing paths to a {@code Process} as * command-line arguments, to remove the requirement implied by relative paths, that the * child must have the same working directory as its parent. */ public String getAbsolutePath() { if (isAbsolute()) { return path; } String userDir = System.getProperty("user.dir"); return path.isEmpty() ? userDir : join(userDir, path); }
/** * Constructs a new File using the specified directory path and file name, * placing a path separator between the two. * * @param dirPath * the path to the directory where the file is stored. * @param name * the file's name. * @throws NullPointerException * if {@code name == null}. */ public File(String dirPath, String name) { if (name == null) { throw new NullPointerException("name == null"); } if (dirPath == null || dirPath.isEmpty()) { this.path = fixSlashes(name); } else if (name.isEmpty()) { this.path = fixSlashes(dirPath); } else { this.path = fixSlashes(join(dirPath, name)); } }
/** * Returns the absolute path of this file. An absolute path is a path that starts at a root * of the file system. On Android, there is only one root: {@code /}. * * <p>A common use for absolute paths is when passing paths to a {@code Process} as * command-line arguments, to remove the requirement implied by relative paths, that the * child must have the same working directory as its parent. */ public String getAbsolutePath() { if (isAbsolute()) { return path; } String userDir = System.getProperty("user.dir"); return path.isEmpty() ? userDir : join(userDir, path); }
/** * Returns the absolute path of this file. An absolute path is a path that starts at a root * of the file system. On Android, there is only one root: {@code /}. * * <p>A common use for absolute paths is when passing paths to a {@code Process} as * command-line arguments, to remove the requirement implied by relative paths, that the * child must have the same working directory as its parent. */ public String getAbsolutePath() { if (isAbsolute()) { return path; } String userDir = System.getProperty("user.dir"); return path.isEmpty() ? userDir : join(userDir, path); }
/** * Returns the absolute path of this file. An absolute path is a path that starts at a root * of the file system. On Android, there is only one root: {@code /}. * * <p>A common use for absolute paths is when passing paths to a {@code Process} as * command-line arguments, to remove the requirement implied by relative paths, that the * child must have the same working directory as its parent. */ public String getAbsolutePath() { if (isAbsolute()) { return path; } String userDir = System.getProperty("user.dir"); return path.isEmpty() ? userDir : join(userDir, path); }
/** * Returns the absolute path of this file. An absolute path is a path that starts at a root * of the file system. On Android, there is only one root: {@code /}. * * <p>A common use for absolute paths is when passing paths to a {@code Process} as * command-line arguments, to remove the requirement implied by relative paths, that the * child must have the same working directory as its parent. */ public String getAbsolutePath() { if (isAbsolute()) { return path; } String userDir = System.getProperty("user.dir"); return path.isEmpty() ? userDir : join(userDir, path); }
/** * Returns the absolute path of this file. An absolute path is a path that starts at a root * of the file system. On Android, there is only one root: {@code /}. * * <p>A common use for absolute paths is when passing paths to a {@code Process} as * command-line arguments, to remove the requirement implied by relative paths, that the * child must have the same working directory as its parent. */ public String getAbsolutePath() { if (isAbsolute()) { return path; } String userDir = System.getProperty("user.dir"); return path.isEmpty() ? userDir : join(userDir, path); }
/** * Returns the absolute path of this file. An absolute path is a path that starts at a root * of the file system. On Android, there is only one root: {@code /}. * * <p>A common use for absolute paths is when passing paths to a {@code Process} as * command-line arguments, to remove the requirement implied by relative paths, that the * child must have the same working directory as its parent. */ public String getAbsolutePath() { if (isAbsolute()) { return path; } String userDir = System.getProperty("user.dir"); return path.isEmpty() ? userDir : join(userDir, path); }
/** * Constructs a new File using the specified directory path and file name, * placing a path separator between the two. * * @param dirPath * the path to the directory where the file is stored. * @param name * the file's name. * @throws NullPointerException * if {@code name == null}. */ public File(String dirPath, String name) { if (name == null) { throw new NullPointerException("name == null"); } if (dirPath == null || dirPath.isEmpty()) { this.path = fixSlashes(name); } else if (name.isEmpty()) { this.path = fixSlashes(dirPath); } else { this.path = fixSlashes(join(dirPath, name)); } }
/** * Constructs a new File using the specified directory path and file name, * placing a path separator between the two. * * @param dirPath * the path to the directory where the file is stored. * @param name * the file's name. * @throws NullPointerException * if {@code name == null}. */ public File(String dirPath, String name) { if (name == null) { throw new NullPointerException("name == null"); } if (dirPath == null || dirPath.isEmpty()) { this.path = fixSlashes(name); } else if (name.isEmpty()) { this.path = fixSlashes(dirPath); } else { this.path = fixSlashes(join(dirPath, name)); } }
/** * Constructs a new File using the specified directory path and file name, * placing a path separator between the two. * * @param dirPath * the path to the directory where the file is stored. * @param name * the file's name. * @throws NullPointerException * if {@code name == null}. */ public File(String dirPath, String name) { if (name == null) { throw new NullPointerException("name == null"); } if (dirPath == null || dirPath.isEmpty()) { this.path = fixSlashes(name); } else if (name.isEmpty()) { this.path = fixSlashes(dirPath); } else { this.path = fixSlashes(join(dirPath, name)); } }
/** * Constructs a new File using the specified directory path and file name, * placing a path separator between the two. * * @param dirPath * the path to the directory where the file is stored. * @param name * the file's name. * @throws NullPointerException * if {@code name == null}. */ public File(String dirPath, String name) { if (name == null) { throw new NullPointerException("name == null"); } if (dirPath == null || dirPath.isEmpty()) { this.path = fixSlashes(name); } else if (name.isEmpty()) { this.path = fixSlashes(dirPath); } else { this.path = fixSlashes(join(dirPath, name)); } }
/** * Constructs a new File using the specified directory path and file name, * placing a path separator between the two. * * @param dirPath * the path to the directory where the file is stored. * @param name * the file's name. * @throws NullPointerException * if {@code name == null}. */ public File(String dirPath, String name) { if (name == null) { throw new NullPointerException("name == null"); } if (dirPath == null || dirPath.isEmpty()) { this.path = fixSlashes(name); } else if (name.isEmpty()) { this.path = fixSlashes(dirPath); } else { this.path = fixSlashes(join(dirPath, name)); } }
/** * Constructs a new File using the specified directory path and file name, * placing a path separator between the two. * * @param dirPath * the path to the directory where the file is stored. * @param name * the file's name. * @throws NullPointerException * if {@code name == null}. */ public File(String dirPath, String name) { if (name == null) { throw new NullPointerException("name == null"); } if (dirPath == null || dirPath.isEmpty()) { this.path = fixSlashes(name); } else if (name.isEmpty()) { this.path = fixSlashes(dirPath); } else { this.path = fixSlashes(join(dirPath, name)); } }