use of diskCacheV111.util.FileNotFoundCacheException in project dcache by dCache.
the class Storage method listDirectory.
@Override
public List<FileMetaData> listDirectory(SRMUser user, URI surl, final boolean verbose, int offset, int count) throws SRMException {
try {
FsPath path = getPath(surl);
Subject subject = asDcacheUser(user).getSubject();
Restriction restriction = asDcacheUser(user).getRestriction();
FmdListPrinter printer = verbose ? new VerboseListPrinter() : new FmdListPrinter();
Range<Integer> range = offset < Integer.MAX_VALUE - count ? Range.closedOpen(offset, offset + count) : Range.atLeast(offset);
_listSource.printDirectory(subject, restriction, printer, path, null, range);
return printer.getResult();
} catch (TimeoutCacheException e) {
throw new SRMInternalErrorException("Internal name space timeout", e);
} catch (InterruptedException e) {
throw new SRMInternalErrorException("List aborted by administrator", e);
} catch (NotDirCacheException e) {
throw new SRMInvalidPathException("Not a directory", e);
} catch (FileNotFoundCacheException e) {
throw new SRMInvalidPathException("No such file or directory", e);
} catch (PermissionDeniedCacheException e) {
throw new SRMAuthorizationException("Permission denied", e);
} catch (CacheException e) {
throw new SRMException(String.format("List failed [rc=%d,msg=%s]", e.getRc(), e.getMessage()));
}
}
Aggregations