Here you can find the source of mkdirs(String destination)
Parameter | Description |
---|---|
destination | the directory to create. |
public static void mkdirs(String destination)
//package com.java2s; /******************************************************************************* * Copyright (c) 2008-2009 SWTBot Committers 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 * // w ww .j av a 2 s. c o m * Contributors: * Ketan Padegaonkar - initial API and implementation *******************************************************************************/ import java.io.*; public class Main { /** * Creates directory specified by destination, and all its parents if they don't exist. * * @param destination the directory to create. */ public static void mkdirs(String destination) { mkdirs(new File(destination)); } /** * Creates directory specified by destination, and all its parents if they don't exist. * * @param destination the directory to create. */ public static void mkdirs(File destination) { if (destination.exists()) { return; } if (!destination.mkdirs()) { throw new RuntimeException("Unable to create directory [" + destination + "]."); } } }