FileUtils { public static void createDirs(File target) throws AdeUsageException { if (!target.exists() && !target.mkdirs() && !target.exists()) { throw new AdeUsageException("Failed creating directory " + target.getPath()); } } private  FileUtils(); static void createDir(File target); static void createDirs(File target); static File[] listFilesSorted(File directory); static PrintWriter openPrintWriterToFile(File file, boolean verbose); static void assertExists(File... files);  }
@Test public void testCreateDirs() throws Exception { File newParentDir = new File(tempFolder.getRoot(), "newParentDir"); File newChildDir = new File(newParentDir, "newChildDir"); FileUtils.createDirs(newChildDir); assertTrue("Assert new directory created", newParentDir.exists()); assertTrue("Assert new directory created", newChildDir.exists()); }