@Test public void createDirectoryTest() { Path path; try { path = Files.createTempDirectory(""); FileUtils.createDirectory(path.toFile().getCanonicalPath()); } catch (IOException e) { fail("Run 'createDirectoryTest' failed, unexpected to catch IOException: " + e.getMessage()); } try { FileUtils.createDirectory(null); fail("Run 'createDirectoryTest' failed, expected to occur IOException but not"); } catch (IOException e) { assertEquals("Path is null", e.getMessage()); } }
public static void createDirectory(String pathName) throws IOException { if (pathName == null) { throw new IOException("Path is null"); } File path = new File(pathName); if (path.exists()) { return; } if (!path.mkdirs()) { throw new IOException("Failed to create directory"); } }
FileUtils { public static void createDirectory(String pathName) throws IOException { if (pathName == null) { throw new IOException("Path is null"); } File path = new File(pathName); if (path.exists()) { return; } if (!path.mkdirs()) { throw new IOException("Failed to create directory"); } } }
FileUtils { public static void createDirectory(String pathName) throws IOException { if (pathName == null) { throw new IOException("Path is null"); } File path = new File(pathName); if (path.exists()) { return; } if (!path.mkdirs()) { throw new IOException("Failed to create directory"); } }  }
FileUtils { public static void createDirectory(String pathName) throws IOException { if (pathName == null) { throw new IOException("Path is null"); } File path = new File(pathName); if (path.exists()) { return; } if (!path.mkdirs()) { throw new IOException("Failed to create directory"); } }  static void createDirectory(String pathName); static Path createTempDirectory(String pathName); static Map<String, byte[]> getFilesGroupByFilename(String pathName); static void deleteDirectory(String pathName); }
FileUtils { public static void createDirectory(String pathName) throws IOException { if (pathName == null) { throw new IOException("Path is null"); } File path = new File(pathName); if (path.exists()) { return; } if (!path.mkdirs()) { throw new IOException("Failed to create directory"); } }  static void createDirectory(String pathName); static Path createTempDirectory(String pathName); static Map<String, byte[]> getFilesGroupByFilename(String pathName); static void deleteDirectory(String pathName);  }