Here you can find the source of mkPath(Path nf)
private static void mkPath(Path nf) throws IOException
//package com.java2s; /******************************************************************************* * Copyright (c) 2011 The Board of Trustees of the Leland Stanford Junior University * as Operator of the SLAC National Accelerator Laboratory. * Copyright (c) 2011 Brookhaven National Laboratory. * EPICS archiver appliance is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. *******************************************************************************/ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; public class Main { private static void mkPath(Path nf) throws IOException { if (!Files.exists(nf)) { Files.createDirectories(nf.getParent()); Files.createFile(nf); }/*from w w w . j a v a 2 s.co m*/ } }