List of utility methods to do Directory Create nio
File | mkdir(final File dir) mkdir if (dir == null) { throw new NullPointerException("argument 'dir' is null"); return Files.createDirectories(dir.toPath()).toFile(); |
void | mkdir(final File dir) mkdir mkdir(dir.toPath()); |
Path | mkdirs(Path dir, FileAttribute>... attrs) Creates the directory and parents of the provided directory. if (dir != null) { if (!Files.exists(dir)) Files.createDirectories(dir); else if (!Files.isDirectory(dir)) throw new NotDirectoryException(dir.toString()); return dir; |
void | mkdirs(Path path) Creates a directory by creating all nonexistent parent directories first. try { Files.createDirectories(path); } catch (IOException e) { throw new IllegalStateException("Unable to create directory: " + path, e); |
boolean | mkdirs(Path path) mkdirs try { Files.createDirectories(path); return true; } catch (Exception e) { return false; |
void | mkPath(Path nf) mk Path if (!Files.exists(nf)) {
Files.createDirectories(nf.getParent());
Files.createFile(nf);
|