Here you can find the source of makeDirs(@Nullable File dir)
Parameter | Description |
---|---|
dir | directory to create, along with any required parent dirs |
Parameter | Description |
---|---|
IOException | if any of the dirs do not exist and can't be created |
public static void makeDirs(@Nullable File dir) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; import javax.annotation.Nullable; public class Main { /**/*from w ww . j ava2s. co m*/ * Creates dir and its parents * @param dir directory to create, along with any required parent dirs * @throws IOException if any of the dirs do not exist and can't be created */ public static void makeDirs(@Nullable File dir) throws IOException { if (dir != null && !dir.exists() && !dir.mkdirs()) { throw new IOException("unable to create directory (or parents): " + dir); } } }