Here you can find the source of mkdir(String dir_str)
Parameter | Description |
---|---|
dir_str | The path of the directory. |
public static boolean mkdir(String dir_str)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { /**/*w ww . jav a2s .c om*/ * A simple method that creates a directory if it does not exists. * * @param dir_str The path of the directory. * @return A boolean value that should signify the directory's existence. If FALSE, you should assume that there was an issue while creating it. */ public static boolean mkdir(String dir_str) { File dir = new File(dir_str); if (!dir.exists()) { try { dir.mkdir(); return true; } catch (SecurityException se) { se.printStackTrace(); return false; } } else { return true; } } }