create Folder - Java File Path IO

Java examples for File Path IO:Directory Create

Description

create Folder

Demo Code


//package com.java2s;
import java.io.File;

public class Main {
    public static void main(String[] argv) throws Exception {
        String folderPath = "java2s.com";
        System.out.println(createFolder(folderPath));
    }// w  ww.ja va2 s.  c  o m

    public static boolean createFolder(String folderPath) {
        File outputFolder = new File(folderPath);

        if (outputFolder.exists())
            return true;
        return outputFolder.mkdir();
    }
}

Related Tutorials