Here you can find the source of mkdirs(File dir)
public static File mkdirs(File dir)
//package com.java2s; /*/*from ww w . j a v a 2 s .c o m*/ * Copyright (c) 2004, simontsui, Chris Leung. 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. */ import java.io.File; public class Main { public static File mkdirs(File dir) { if (dir == null) return null; if (!dir.exists() && !dir.mkdirs()) throw new RuntimeException("ERROR: mkdirs: " + dir); return dir; } }