Here you can find the source of mkdir(File dirFile)
Parameter | Description |
---|---|
dirFile | a parameter |
public static void mkdir(File dirFile)
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { /**//w w w . j a va 2s . c om * Create a directory by calling mkdir(); * * @param dirFile */ public static void mkdir(File dirFile) { System.out.println("Creating the folder: " + dirFile); try { // File dirFile = new File(mkdirName); boolean bFile = dirFile.exists(); if (bFile == true) { System.out.println("The folder exists."); } else { System.out.println("The folder do not exist,now trying to create a one..."); bFile = dirFile.mkdir(); if (bFile == true) { System.out.println("Create successfully!"); } else { System.out.println("Disable to make the folder,please check the disk is full or not."); System.exit(1); } } } catch (Exception err) { System.err.println("ELS - Chart : unexpected error"); err.printStackTrace(); } } }