@Test void createFoldersExistingFile() throws IOException { Path path = Paths.get(rootProjectDir.getRoot().toPath().toString(), "test.f"); Files.touch(path.toFile()); assertThrows(DocumentFileUtilsException.class, () -> DocumentFileUtils.INSTANCE.createFolders(path)); }
public synchronized void createFolders(Path folderPath) { if (!folderPath.toFile().exists()) { try { Files.createDirectories(folderPath); } catch (IOException e) { throw new DocumentFileUtilsException("Exception creating folder(s): " + folderPath, e); } } else if (!folderPath.toFile().isDirectory()) { throw new DocumentFileUtilsException("Wanted to create folder but found a file: " + folderPath); } }
DocumentFileUtils { public synchronized void createFolders(Path folderPath) { if (!folderPath.toFile().exists()) { try { Files.createDirectories(folderPath); } catch (IOException e) { throw new DocumentFileUtilsException("Exception creating folder(s): " + folderPath, e); } } else if (!folderPath.toFile().isDirectory()) { throw new DocumentFileUtilsException("Wanted to create folder but found a file: " + folderPath); } } }
DocumentFileUtils { public synchronized void createFolders(Path folderPath) { if (!folderPath.toFile().exists()) { try { Files.createDirectories(folderPath); } catch (IOException e) { throw new DocumentFileUtilsException("Exception creating folder(s): " + folderPath, e); } } else if (!folderPath.toFile().isDirectory()) { throw new DocumentFileUtilsException("Wanted to create folder but found a file: " + folderPath); } } private  DocumentFileUtils(DocumentTools documentTools); }
DocumentFileUtils { public synchronized void createFolders(Path folderPath) { if (!folderPath.toFile().exists()) { try { Files.createDirectories(folderPath); } catch (IOException e) { throw new DocumentFileUtilsException("Exception creating folder(s): " + folderPath, e); } } else if (!folderPath.toFile().isDirectory()) { throw new DocumentFileUtilsException("Wanted to create folder but found a file: " + folderPath); } } private  DocumentFileUtils(DocumentTools documentTools); void createFile(Element element, Path path); void createFile(Element element, Path path, boolean addNamespace); synchronized void createFolder(Path folderPath); synchronized void createFolders(Path folderPath); }
DocumentFileUtils { public synchronized void createFolders(Path folderPath) { if (!folderPath.toFile().exists()) { try { Files.createDirectories(folderPath); } catch (IOException e) { throw new DocumentFileUtilsException("Exception creating folder(s): " + folderPath, e); } } else if (!folderPath.toFile().isDirectory()) { throw new DocumentFileUtilsException("Wanted to create folder but found a file: " + folderPath); } } private  DocumentFileUtils(DocumentTools documentTools); void createFile(Element element, Path path); void createFile(Element element, Path path, boolean addNamespace); synchronized void createFolder(Path folderPath); synchronized void createFolders(Path folderPath); static final DocumentFileUtils INSTANCE; static final String BUNDLE_EXTENSION; static final String DELETE_BUNDLE_EXTENSION; static final String INSTALL_BUNDLE_EXTENSION; static final String PREFIX_ENVIRONMENT; static final String PREFIX_FULL; }