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"); }
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 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"); }
@Override public String answer(InvocationOnMock invocation) throws Throwable { if (!exists.get()) { throw new NoSuchFileException(); } return "content"; } });
@Override public String answer(InvocationOnMock invocation) throws Throwable { if (!exists.get()) { throw new NoSuchFileException(); } return "content"; } });
@Override public void delete(final Path path, final DeleteOption... options) throws NoSuchFileException, DirectoryNotEmptyException, IOException, SecurityException { checkNotNull("path", path); if (!path.toFile().exists()) { throw new NoSuchFileException(path.toString()); } deleteIfExists(path, options); }
@Override public void delete(final Path path, final DeleteOption... options) throws NoSuchFileException, DirectoryNotEmptyException, IOException, SecurityException { checkNotNull("path", path); if (!path.toFile().exists()) { throw new NoSuchFileException(path.toString()); } deleteIfExists(path, options); }
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"); }
@Test public void testAcceptWithNoSuchFileException() { doThrow(new NoSuchFileException()).when(path).getFileName(); assertFalse(observer.accept(path)); } }
@Override public void checkAccess(final Path path, final AccessMode... modes) throws UnsupportedOperationException, NoSuchFileException, AccessDeniedException, IOException, SecurityException { checkNotNull("path", path); final JGitPathImpl gPath = toPathImpl(path); final Pair<PathType, ObjectId> result = checkPath(gPath.getFileSystem().gitRepo(), gPath.getRefTree(), gPath.getPath()); if (result.getK1().equals(NOT_FOUND)) { throw new NoSuchFileException(path.toString()); } }
@Test public void retrieveLockInfoNoSuchFileException() { when(ioService.exists(any(org.uberfire.java.nio.file.Path.class))).thenReturn(true); when(ioService.readAllString(any(org.uberfire.java.nio.file.Path.class))).thenThrow(new NoSuchFileException()); final LockInfo info = lockService.retrieveLockInfo(path); assertFalse(info.isLocked()); assertNull(info.lockedBy()); }
@Test public void retrieveLockInfoNoSuchFileException() { when(ioService.exists(any(org.uberfire.java.nio.file.Path.class))).thenReturn(true); when(ioService.readAllString(any(org.uberfire.java.nio.file.Path.class))).thenThrow(new NoSuchFileException()); final LockInfo info = lockService.retrieveLockInfo(path); assertFalse(info.isLocked()); assertNull(info.lockedBy()); }
public void deleteBranch(final JGitPathImpl path) { final Ref branch = getBranch(path.getFileSystem().gitRepo(), path.getRefTree()); if (branch == null) { throw new NoSuchFileException(path.toString()); } JGitUtil.deleteBranch(path.getFileSystem().gitRepo(), branch); }
public void deleteBranch(final JGitPathImpl path) { final Ref branch = path.getFileSystem().getGit().getRef(path.getRefTree()); if (branch == null) { throw new NoSuchFileException(path.toString()); } try { path.getFileSystem().lock(); path.getFileSystem().getGit().deleteRef(branch); } finally { path.getFileSystem().unlock(); } }