Here you can find the source of mkdir(File directory)
Parameter | Description |
---|---|
directory | a parameter |
Parameter | Description |
---|---|
IllegalStateException | an exception |
public static void mkdir(File directory) throws IllegalStateException
//package com.java2s; import java.io.File; public class Main { /**/*www .j av a 2 s . co m*/ * Creates the specified directory. Throws an IllegalStateException if the * directory cannot be created. * * @param directory * @throws IllegalStateException */ public static void mkdir(File directory) throws IllegalStateException { if (!directory.exists()) { boolean succeeded = directory.mkdirs(); if (!succeeded) { throw new IllegalStateException( String.format("Error while creating directory: %s", directory.getAbsolutePath())); } } } }