Here you can find the source of makeDirectory(File file)
Parameter | Description |
---|---|
file | a parameter |
Parameter | Description |
---|---|
IOException | If it failed to create directories |
public static void makeDirectory(File file) throws IOException
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { /**// www .j a v a 2 s. c om * Creates directories if not exists. * @param file * @throws IOException If it failed to create directories */ public static void makeDirectory(File file) throws IOException { if (!file.isDirectory()) { if (!file.mkdirs() || !file.isDirectory()) { throw new IOException("can't make directory: " + file); } } } }