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
659a26f0
Commit
659a26f0
authored
3 years ago
by
Nicola Fulvio Calabria
Browse files
Options
Downloads
Patches
Plain Diff
Correct DuplicateNodeException thrown when destination of move already
exists
parent
d63066de
No related branches found
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/MoveService.java
+4
-0
4 additions, 0 deletions
src/main/java/it/inaf/oats/vospace/MoveService.java
src/test/java/it/inaf/oats/vospace/CopyServiceTest.java
+0
-2
0 additions, 2 deletions
src/test/java/it/inaf/oats/vospace/CopyServiceTest.java
with
4 additions
and
2 deletions
src/main/java/it/inaf/oats/vospace/MoveService.java
+
4
−
0
View file @
659a26f0
...
...
@@ -7,6 +7,7 @@ package it.inaf.oats.vospace;
import
it.inaf.ia2.aa.data.User
;
import
it.inaf.oats.vospace.datamodel.NodeUtils
;
import
it.inaf.oats.vospace.exception.DuplicateNodeException
;
import
it.inaf.oats.vospace.exception.InternalFaultException
;
import
it.inaf.oats.vospace.exception.NodeBusyException
;
import
it.inaf.oats.vospace.exception.NodeNotFoundException
;
...
...
@@ -15,6 +16,7 @@ import it.inaf.oats.vospace.persistence.NodeDAO.ShortNodeDescriptor;
import
java.util.Optional
;
import
net.ivoa.xml.vospace.v2.Transfer
;
import
org.springframework.dao.CannotSerializeTransactionException
;
import
org.springframework.dao.DuplicateKeyException
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.transaction.annotation.Isolation
;
...
...
@@ -105,6 +107,8 @@ public class MoveService extends AbstractNodeService {
}
catch
(
CannotSerializeTransactionException
ex
)
{
// Concurrent transactions attempted to modify this set of nodes
throw
new
NodeBusyException
(
sourcePath
);
}
catch
(
DuplicateKeyException
ex
)
{
throw
new
DuplicateNodeException
(
destinationPath
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/test/java/it/inaf/oats/vospace/CopyServiceTest.java
+
0
−
2
View file @
659a26f0
...
...
@@ -11,7 +11,6 @@ import it.inaf.oats.vospace.exception.NodeNotFoundException;
import
it.inaf.oats.vospace.exception.PermissionDeniedException
;
import
it.inaf.oats.vospace.persistence.DataSourceConfigSingleton
;
import
it.inaf.oats.vospace.persistence.NodeDAO
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Optional
;
import
net.ivoa.xml.vospace.v2.Transfer
;
...
...
@@ -28,7 +27,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.dao.DuplicateKeyException
;
import
org.springframework.test.annotation.DirtiesContext
;
import
org.springframework.test.context.TestPropertySource
;
import
org.springframework.test.context.ContextConfiguration
;
...
...
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