Search in sources :

Example 91 with FileNotFoundCacheException

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()));
    }
}
Also used : SRMAuthorizationException(org.dcache.srm.SRMAuthorizationException) FileIsNewCacheException(diskCacheV111.util.FileIsNewCacheException) FileExistsCacheException(diskCacheV111.util.FileExistsCacheException) NotDirCacheException(diskCacheV111.util.NotDirCacheException) FileNotFoundCacheException(diskCacheV111.util.FileNotFoundCacheException) TimeoutCacheException(diskCacheV111.util.TimeoutCacheException) CacheException(diskCacheV111.util.CacheException) FileCorruptedCacheException(diskCacheV111.util.FileCorruptedCacheException) PermissionDeniedCacheException(diskCacheV111.util.PermissionDeniedCacheException) SRMInvalidPathException(org.dcache.srm.SRMInvalidPathException) Subject(javax.security.auth.Subject) SRMInternalErrorException(org.dcache.srm.SRMInternalErrorException) Restriction(org.dcache.auth.attributes.Restriction) PermissionDeniedCacheException(diskCacheV111.util.PermissionDeniedCacheException) SRMException(org.dcache.srm.SRMException) FileNotFoundCacheException(diskCacheV111.util.FileNotFoundCacheException) NotDirCacheException(diskCacheV111.util.NotDirCacheException) FsPath(diskCacheV111.util.FsPath) TimeoutCacheException(diskCacheV111.util.TimeoutCacheException)

Aggregations

FileNotFoundCacheException (diskCacheV111.util.FileNotFoundCacheException)85 CacheException (diskCacheV111.util.CacheException)80 PermissionDeniedCacheException (diskCacheV111.util.PermissionDeniedCacheException)61 NotDirCacheException (diskCacheV111.util.NotDirCacheException)51 FileExistsCacheException (diskCacheV111.util.FileExistsCacheException)44 FileIsNewCacheException (diskCacheV111.util.FileIsNewCacheException)34 FileAttributes (org.dcache.vehicles.FileAttributes)34 NotFileCacheException (diskCacheV111.util.NotFileCacheException)33 FileCorruptedCacheException (diskCacheV111.util.FileCorruptedCacheException)31 FsPath (diskCacheV111.util.FsPath)31 InvalidMessageCacheException (diskCacheV111.util.InvalidMessageCacheException)28 TimeoutCacheException (diskCacheV111.util.TimeoutCacheException)27 NoAttributeCacheException (diskCacheV111.util.NoAttributeCacheException)24 FileNotFoundChimeraFsException (org.dcache.chimera.FileNotFoundChimeraFsException)24 AttributeExistsCacheException (diskCacheV111.util.AttributeExistsCacheException)23 PnfsId (diskCacheV111.util.PnfsId)21 LockedCacheException (diskCacheV111.util.LockedCacheException)20 MissingResourceCacheException (diskCacheV111.util.MissingResourceCacheException)19 FileAttribute (org.dcache.namespace.FileAttribute)18 IOException (java.io.IOException)17