|
@@ -621,7 +621,8 @@ public class ViewFs extends AbstractFileSystem {
|
|
|
|
|
|
@Override
|
|
|
public boolean isValidName(String src) {
|
|
|
- // Prefix validated at mount time and rest of path validated by mount target.
|
|
|
+ // Prefix validated at mount time and rest of path validated by mount
|
|
|
+ // target.
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -714,8 +715,31 @@ public class ViewFs extends AbstractFileSystem {
|
|
|
fsState.resolve(getUriPath(path), true);
|
|
|
res.targetFileSystem.removeXAttr(res.remainingPath, name);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Path createSnapshot(Path path, String snapshotName)
|
|
|
+ throws IOException {
|
|
|
+ InodeTree.ResolveResult<AbstractFileSystem> res = fsState.resolve(
|
|
|
+ getUriPath(path), true);
|
|
|
+ return res.targetFileSystem.createSnapshot(res.remainingPath, snapshotName);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void renameSnapshot(Path path, String snapshotOldName,
|
|
|
+ String snapshotNewName) throws IOException {
|
|
|
+ InodeTree.ResolveResult<AbstractFileSystem> res = fsState.resolve(
|
|
|
+ getUriPath(path), true);
|
|
|
+ res.targetFileSystem.renameSnapshot(res.remainingPath, snapshotOldName,
|
|
|
+ snapshotNewName);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void deleteSnapshot(Path path, String snapshotName) throws IOException {
|
|
|
+ InodeTree.ResolveResult<AbstractFileSystem> res = fsState.resolve(
|
|
|
+ getUriPath(path), true);
|
|
|
+ res.targetFileSystem.deleteSnapshot(res.remainingPath, snapshotName);
|
|
|
+ }
|
|
|
+
|
|
|
/*
|
|
|
* An instance of this class represents an internal dir of the viewFs
|
|
|
* ie internal dir of the mount table.
|
|
@@ -1025,5 +1049,26 @@ public class ViewFs extends AbstractFileSystem {
|
|
|
checkPathIsSlash(path);
|
|
|
throw readOnlyMountTable("removeXAttr", path);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Path createSnapshot(Path path, String snapshotName)
|
|
|
+ throws IOException {
|
|
|
+ checkPathIsSlash(path);
|
|
|
+ throw readOnlyMountTable("createSnapshot", path);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void renameSnapshot(Path path, String snapshotOldName,
|
|
|
+ String snapshotNewName) throws IOException {
|
|
|
+ checkPathIsSlash(path);
|
|
|
+ throw readOnlyMountTable("renameSnapshot", path);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void deleteSnapshot(Path path, String snapshotName)
|
|
|
+ throws IOException {
|
|
|
+ checkPathIsSlash(path);
|
|
|
+ throw readOnlyMountTable("deleteSnapshot", path);
|
|
|
+ }
|
|
|
}
|
|
|
}
|