Java Path Create nio createRandomFolder(Path basePath)

Here you can find the source of createRandomFolder(Path basePath)

Description

create Random Folder

License

Open Source License

Declaration

public static Path createRandomFolder(Path basePath) throws IOException 

Method Source Code


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

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

public class Main {
    private static int FOLDER_NUMBER = 0;

    public static Path createRandomFolder(Path basePath) throws IOException {
        String folderName = "f" + FOLDER_NUMBER++;
        Path p = basePath.resolve(folderName);
        Files.createDirectory(p);
        return p;
    }// w ww .j a  v  a2 s .c o  m
}

Related

  1. createPathMatcher(String[] patterns)
  2. createPathOrNull(String pathString)
  3. createPathRelativizer(Path path, boolean doRelativize)
  4. createProperties(final Path directory, final Properties properties)
  5. createRandomClass(String className, Path dir)
  6. createRandomFolders(Path basePath, int numberOfFolders)
  7. createRelativePath(File baseDirFile, File file)
  8. createSourceFile(Path path, String... lines)
  9. createSymbolicLink(String linkPathString, String targetPathString)