private static FileSystemProvider providerOf(final Path path) { return path.getFileSystem().provider(); }
public static Path dot(final Path path) { if (path.getFileName() == null) { return path.resolve(".root"); } return path.resolveSibling("." + path.getFileName()); }
private boolean hasContent(Path dir) { // TODO remove this filter when AF-1073 is resolved try (DirectoryStream<Path> children = newDirectoryStream(dir, path -> !path.endsWith("readme.md"))) { return children.iterator().hasNext(); } }
private Path getWorkingDir(String workingDir){ if(workingDir!= null){ return Paths.get("file://"+workingDir); } return null; }
@Test(expected = IllegalArgumentException.class) public void visitFileNull1() { final Path dir = newTempDir(null); final Path file = Files.createTempFile(dir, "foo", "bar"); simple.visitFile(null, Files.readAttributes(file, BasicFileAttributes.class)); }
@Test(expected = IllegalArgumentException.class) public void preVisitDirectoryNull1() { final Path dir = newTempDir(null); final Path file = Files.createTempFile(dir, "foo", "bar"); simple.preVisitDirectory(null, Files.readAttributes(file, BasicFileAttributes.class)); }
public static Path createTempDirectory(final String prefix, final FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, IOException, SecurityException { return createTempDirectory(TEMP_PATH, prefix, attrs); }
public static Path walkFileTree(final Path start, final Set<FileVisitOption> options, final int maxDepth, final FileVisitor<Path> visitor) throws IllegalArgumentException, SecurityException, IOException { new FileTreeWalker(visitor, maxDepth).walk(start); return start; }
@Test(expected = IllegalArgumentException.class) public void visitFileFailedNull1() { final Path dir = newTempDir(null); final Path file = Files.createTempFile(dir, "foo", "bar"); simple.visitFileFailed(file, null); }
@Test public void postVisitDirectoryNull1() { final Path dir = newTempDir(null); final Path file = Files.createTempFile(dir, "foo", "bar"); simple.postVisitDirectory(dir, null); }
public static Path createTempFile(final String prefix, final String suffix, final FileAttribute<?>... attrs) throws IllegalArgumentException, UnsupportedOperationException, IOException, SecurityException { return createTempFile(TEMP_PATH, prefix, suffix, attrs); }
@Override public WatchKey register(WatchService watcher, Kind<?>[] events, Modifier... modifiers) throws UnsupportedOperationException, IllegalArgumentException, ClosedWatchServiceException, IOException, SecurityException { return watcher.poll(); }
private static FileSystemProvider providerOf(final Path path) { return path.getFileSystem().provider(); }
private boolean hasContent(Path dir) { // TODO remove this filter when AF-1073 is resolved try (DirectoryStream<Path> children = newDirectoryStream(dir, path -> !path.endsWith("readme.md"))) { return children.iterator().hasNext(); } }
@Override public WatchKey register(WatchService watcher, Kind<?>... events) throws UnsupportedOperationException, IllegalArgumentException, ClosedWatchServiceException, IOException, SecurityException { return watcher.poll(); }