Java Utililty Methods Directory Create nio

List of utility methods to do Directory Create nio

Description

The list of methods to do Directory Create nio are organized into topic(s).

Method

Filemkdir(final File dir)
mkdir
if (dir == null) {
    throw new NullPointerException("argument 'dir' is null");
return Files.createDirectories(dir.toPath()).toFile();
voidmkdir(final File dir)
mkdir
mkdir(dir.toPath());
Pathmkdirs(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;
voidmkdirs(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);
booleanmkdirs(Path path)
mkdirs
try {
    Files.createDirectories(path);
    return true;
} catch (Exception e) {
    return false;
voidmkPath(Path nf)
mk Path
if (!Files.exists(nf)) {
    Files.createDirectories(nf.getParent());
    Files.createFile(nf);