@Override public boolean notExists(final Path path) throws IllegalArgumentException, SecurityException { return Files.notExists(path); }
@Override public boolean notExists(Path path, LinkOption... options) throws IllegalArgumentException { return Files.notExists(fromPath(path), options); }
public static Set<PosixFilePermission> getPosixFilePermissions(final Path path, final LinkOption... options) throws UnsupportedOperationException, IOException, SecurityException { checkNotNull("path", path); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
public static UserPrincipal getOwner(final Path path, final LinkOption... options) throws UnsupportedOperationException, IOException, SecurityException { checkNotNull("path", path); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
public static UserPrincipal getOwner(final Path path, final LinkOption... options) throws UnsupportedOperationException, IOException, SecurityException { checkNotNull("path", path); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
public static UserPrincipal getOwner(final Path path, final LinkOption... options) throws UnsupportedOperationException, IOException, SecurityException { checkNotNull("path", path); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
public static Set<PosixFilePermission> getPosixFilePermissions(final Path path, final LinkOption... options) throws UnsupportedOperationException, IOException, SecurityException { checkNotNull("path", path); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
public static Set<PosixFilePermission> getPosixFilePermissions(final Path path, final LinkOption... options) throws UnsupportedOperationException, IOException, SecurityException { checkNotNull("path", path); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
public static Path setOwner(final Path path, final UserPrincipal owner) throws UnsupportedOperationException, IOException, SecurityException { checkNotNull("path", path); checkNotNull("owner", owner); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
public static Path setOwner(final Path path, final UserPrincipal owner) throws UnsupportedOperationException, IOException, SecurityException { checkNotNull("path", path); checkNotNull("owner", owner); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
public static Path setPosixFilePermissions(final Path path, final Set<PosixFilePermission> perms) throws UnsupportedOperationException, ClassCastException, IOException, SecurityException { checkNotNull("path", path); checkNotNull("perms", perms); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
public static Path setOwner(final Path path, final UserPrincipal owner) throws UnsupportedOperationException, IOException, SecurityException { checkNotNull("path", path); checkNotNull("owner", owner); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
public static Path setPosixFilePermissions(final Path path, final Set<PosixFilePermission> perms) throws UnsupportedOperationException, ClassCastException, IOException, SecurityException { checkNotNull("path", path); checkNotNull("perms", perms); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
public static String probeContentType(final Path path) throws UnsupportedOperationException, IOException, SecurityException { checkNotNull("path", path); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } if (!isRegularFile(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
public static Path setPosixFilePermissions(final Path path, final Set<PosixFilePermission> perms) throws UnsupportedOperationException, ClassCastException, IOException, SecurityException { checkNotNull("path", path); checkNotNull("perms", perms); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
public static String probeContentType(final Path path) throws UnsupportedOperationException, IOException, SecurityException { checkNotNull("path", path); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } if (!isRegularFile(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
public static String probeContentType(final Path path) throws UnsupportedOperationException, IOException, SecurityException { checkNotNull("path", path); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } if (!isRegularFile(path)) { throw new NoSuchFileException(path.toString()); } throw new UnsupportedOperationException("feature not available"); }
@Test public void notExistsNull() { assertThatThrownBy(() -> Files.notExists(null)) .isInstanceOf(IllegalArgumentException.class) .hasMessage("Parameter named 'path' should be not null!"); }
/** * @throws UnsupportedOperationException * @throws IllegalArgumentException * @throws IOException * @throws SecurityException * @see <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#readAttributes(java.nio.file.Path, java.lang.String, java.nio.file.LinkOption...)">Original JavaDoc</a> */ public static Map<String, Object> readAttributes(final Path path, final String attributes, final LinkOption... options) throws UnsupportedOperationException, NoSuchFileException, IllegalArgumentException, IOException, SecurityException { checkNotNull("path", path); checkNotEmpty("attributes", attributes); if (notExists(path)) { throw new NoSuchFileException(path.toString()); } return providerOf(path).readAttributes(path, attributes, options); }
@Test public void notExists() { final Path path = Files.createTempFile("foo", "bar"); assertThat(Files.notExists(path)).isFalse(); assertThat(Files.notExists(newTempDir())).isFalse(); assertThat(Files.notExists(Paths.get("/some/path/here"))).isTrue(); assertThat(Files.notExists(newTempDir().resolve("some.text"))).isTrue(); }