Here you can find the source of mkdirsOrFail(File dirFile)
Parameter | Description |
---|---|
dirFile | directory to be created (may be null ) |
Parameter | Description |
---|---|
IOException | Creation of directory was not successful |
private static void mkdirsOrFail(File dirFile) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.IOException; public class Main { /**//from ww w .ja v a 2 s. co m * Check if given file is directory and try to create it if not. It throws {@link IOException} if the directory doesn't * exist and it's not possible to create it. * * @param dirFile directory to be created (may be {@code null}) * @throws IOException Creation of directory was not successful */ private static void mkdirsOrFail(File dirFile) throws IOException { if (dirFile == null) { return; } if (!dirFile.isDirectory()) { if (!dirFile.mkdirs()) { throw new IOException( "Directory doesn't exist and its creation failed: " + dirFile.getAbsolutePath()); } } } }