Loading src/main/java/it/inaf/oats/vospace/CopyService.java +5 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,11 @@ public class CopyService extends AbstractNodeService { if (destinationPath.startsWith(sourcePath + "/")) { throw new IllegalArgumentException("Cannot copy node to a subdirectory of its own path"); } // Check if destination equals parent path of source if(NodeUtils.getParentPath(sourcePath).equals(destinationPath)){ throw new IllegalArgumentException("Cannot duplicate node at same path without renaming it"); } try { Loading src/main/java/it/inaf/oats/vospace/MoveService.java +5 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,11 @@ public class MoveService extends AbstractNodeService { // Linux-like: "cannot move to a subdirectory of itself" if(destinationPath.startsWith(sourcePath+"/")) { throw new IllegalArgumentException("Cannot move node to a subdirectory of its own path"); } // Check if destination equals parent path of source if(NodeUtils.getParentPath(sourcePath).equals(destinationPath)){ return; } try { Loading Loading
src/main/java/it/inaf/oats/vospace/CopyService.java +5 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,11 @@ public class CopyService extends AbstractNodeService { if (destinationPath.startsWith(sourcePath + "/")) { throw new IllegalArgumentException("Cannot copy node to a subdirectory of its own path"); } // Check if destination equals parent path of source if(NodeUtils.getParentPath(sourcePath).equals(destinationPath)){ throw new IllegalArgumentException("Cannot duplicate node at same path without renaming it"); } try { Loading
src/main/java/it/inaf/oats/vospace/MoveService.java +5 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,11 @@ public class MoveService extends AbstractNodeService { // Linux-like: "cannot move to a subdirectory of itself" if(destinationPath.startsWith(sourcePath+"/")) { throw new IllegalArgumentException("Cannot move node to a subdirectory of its own path"); } // Check if destination equals parent path of source if(NodeUtils.getParentPath(sourcePath).equals(destinationPath)){ return; } try { Loading