Java Path Create nio getOrCreateDir(Path path)

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

Description

get Or Create Dir

License

Open Source License

Declaration

private static File getOrCreateDir(Path path) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;
import java.nio.file.Path;

public class Main {
    private static File getOrCreateDir(Path path) {

        if (path == null) {
            return null;
        }// ww  w  .java  2  s  . c om

        File file = path.toFile();
        if (!file.exists()) {
            file.mkdirs();
        }
        return file;
    }
}

Related

  1. createZipFile(final File pathToArchive)
  2. createZipFileSystem(Path path)
  3. createZipFileSystem(Path zipFile)
  4. createZipFs(Path path)
  5. createZkNodeName(String zkRoot, Path root, Path file)
  6. isTempCreatedFile(Path filePath)
  7. setTimes(FileTime lastModifiedTime, FileTime lastAccessTime, FileTime createTime, Path... files)
  8. toPath(@Nullable String plain)
  9. toPath(String first, String... more)