Here you can find the source of mkdirs(File folder)
public static void mkdirs(File folder) throws RuntimeException
//package com.java2s; /*// www . j ava 2s . c o m * Copyright (c) 2015 Eike Stepper (Berlin, Germany) and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Eike Stepper - initial API and implementation */ import java.io.File; public class Main { public static void mkdirs(File folder) throws RuntimeException { if (folder != null) { if (!folder.isDirectory()) { if (!folder.mkdirs()) { throw new RuntimeException("Unable to create directory " + folder.getAbsolutePath()); //$NON-NLS-1$ } } } } }