use of org.dcache.nfs.status.NoEntException in project dcache by dCache.
the class ChimeraVfs method lookup.
@Override
public Inode lookup(Inode parent, String path) throws IOException {
try {
FsInode parentFsInode = toFsInode(parent);
FsInode fsInode = parentFsInode.inodeOf(path, NO_STAT);
return toInode(fsInode);
} catch (FileNotFoundChimeraFsException e) {
throw new NoEntException("Path Do not exist.");
}
}
use of org.dcache.nfs.status.NoEntException in project dcache by dCache.
the class ChimeraVfs method move.
@Override
public boolean move(Inode src, String oldName, Inode dest, String newName) throws IOException {
FsInode from = toFsInode(src);
FsInode to = toFsInode(dest);
try {
return _fs.rename(_fs.inodeOf(from, oldName, NO_STAT), from, oldName, to, newName);
} catch (NotDirChimeraException e) {
throw new NotDirException("not a directory");
} catch (FileExistsChimeraFsException e) {
throw new ExistException("destination exists");
} catch (DirNotEmptyChimeraFsException e) {
throw new NotEmptyException("directory exist and not empty");
} catch (FileNotFoundChimeraFsException e) {
throw new NoEntException("file not found");
} catch (PermissionDeniedChimeraFsException e) {
throw new PermException(e.getMessage());
}
}
use of org.dcache.nfs.status.NoEntException in project dcache by dCache.
the class MonitoringVfs method remove.
@Override
public void remove(Inode parent, String name) throws IOException {
Optional<PnfsId> parentId = toPnfsId(parent);
Optional<PnfsId> target;
FileType type = FileType.SPECIAL;
try {
Inode targetInode = super.lookup(parent, name);
type = asFileType(super.getattr(targetInode).type());
target = toPnfsId(targetInode);
} catch (NoEntException ignored) {
// don't send event.
target = Optional.empty();
// don't send event.
parentId = Optional.empty();
} catch (IOException e) {
LOGGER.warn("Problem looking up {} in inode {}: {}", name, parent, e.toString());
// don't send event.
target = Optional.empty();
// don't send event.
parentId = Optional.empty();
}
/* REVISIT: update VirtualFileSystem#remove to return attributes of delete item? */
super.remove(parent, name);
FileType t = type;
parentId.ifPresent(id -> eventReceiver.notifyChildEvent(IN_DELETE, id, name, t));
target.ifPresent(id -> eventReceiver.notifySelfEvent(IN_DELETE_SELF, id, t));
}
Aggregations