Java Path Copy nio createDirectoriesIfNotExists(Path path)

Here you can find the source of createDirectoriesIfNotExists(Path path)

Description

create Directories If Not Exists

License

Apache License

Declaration

static public Path createDirectoriesIfNotExists(Path path)
        throws IOException 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.IOException;

import java.nio.file.Files;
import java.nio.file.Path;

public class Main {

    static public Path createDirectoriesIfNotExists(Path path)
            throws IOException {
        if (Files.exists(path)) {
            return path;
        }//w ww .jav  a  2 s  . c  o m
        return Files.createDirectories(path);
    }
}

Related

  1. createDirectories(Path path, FileAttribute... attrs)
  2. createDirectories(Path thePath, FileAttribute... theAttributes)
  3. createDirectoriesForFile(Path file)
  4. createDirectoriesForOutput(File output)
  5. createDirectoriesIfNeeded(Path directory)
  6. createDirectory(Path directory)
  7. createDirectory(Path outDir, boolean cleanExisting)
  8. createDirectory(Path parent, String name)
  9. createDirectoryIfNotExists(Path path)