Here you can find the source of createFolder(String workspacePath)
public static boolean createFolder(String workspacePath)
//package com.java2s; //License from project: Apache License import java.io.File; import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; public class Main { public static boolean createFolder(String workspacePath) { File folder = new File(workspacePath); if (!folder.exists()) { return folder.mkdirs(); }/*from w ww. ja v a 2 s. co m*/ return true; } public static boolean exists(String repositoryName) { if (repositoryName == null || "".equals(repositoryName)) { return false; } Path path; try { path = FileSystems.getDefault().getPath(repositoryName); } catch (java.nio.file.InvalidPathException e) { return false; } return Files.exists(path); } }