Here you can find the source of mkdir(String dname)
public static File mkdir(String dname)
//package com.java2s; /*-/*from w w w . ja v a 2 s . co m*/ * See the file LICENSE for redistribution information. * * Copyright (c) 2010, 2011 Oracle and/or its affiliates. All rights reserved. * */ import java.io.File; public class Main { public static File mkdir(String dname) { File d = new File("TESTDIR"); d.mkdir(); File f = new File(d, dname); rm_rf(f); f.mkdir(); return f; } public static void rm_rf(File f) { if (f.isDirectory()) for (File f2 : f.listFiles()) rm_rf(f2); f.delete(); } }