Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vospace-rest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VOSpace INAF
vospace-rest
Commits
b9fb7a45
Commit
b9fb7a45
authored
3 years ago
by
Nicola Fulvio Calabria
Browse files
Options
Downloads
Patches
Plain Diff
Updated constraints to copy paths
parent
0babd77f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/it/inaf/oats/vospace/CopyService.java
+5
-0
5 additions, 0 deletions
src/main/java/it/inaf/oats/vospace/CopyService.java
src/main/java/it/inaf/oats/vospace/MoveService.java
+5
-0
5 additions, 0 deletions
src/main/java/it/inaf/oats/vospace/MoveService.java
with
10 additions
and
0 deletions
src/main/java/it/inaf/oats/vospace/CopyService.java
+
5
−
0
View file @
b9fb7a45
...
...
@@ -48,6 +48,11 @@ public class CopyService extends AbstractNodeService {
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
{
// check source branch for read and lock it
...
...
This diff is collapsed.
Click to expand it.
src/main/java/it/inaf/oats/vospace/MoveService.java
+
5
−
0
View file @
b9fb7a45
...
...
@@ -52,6 +52,11 @@ public class MoveService extends AbstractNodeService {
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
{
// Get source node
Optional
<
Long
>
sourceIdOpt
=
nodeDao
.
getNodeId
(
sourcePath
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment