Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vospace-datamodel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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-datamodel
Commits
af9345e9
Commit
af9345e9
authored
4 years ago
by
Sara Bertocco
Browse files
Options
Downloads
Patches
Plain Diff
Working on task #3635 - Refactoring: create NodeUtils class
parent
5c4d42c2
No related branches found
No related tags found
No related merge requests found
Pipeline
#959
passed
4 years ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/it/inaf/oats/vospace/datamodel/NodeProperties.java
+13
-0
13 additions, 0 deletions
...n/java/it/inaf/oats/vospace/datamodel/NodeProperties.java
src/main/java/it/inaf/oats/vospace/datamodel/NodeUtils.java
+2
-4
2 additions, 4 deletions
src/main/java/it/inaf/oats/vospace/datamodel/NodeUtils.java
with
15 additions
and
4 deletions
src/main/java/it/inaf/oats/vospace/datamodel/NodeProperties.java
+
13
−
0
View file @
af9345e9
...
...
@@ -8,6 +8,7 @@ package it.inaf.oats.vospace.datamodel;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
net.ivoa.xml.vospace.v2.Node
;
import
net.ivoa.xml.vospace.v2.Property
;
/**
*
...
...
@@ -44,6 +45,18 @@ public class NodeProperties {
public
static
final
String
TYPE_URI
=
"ivo://ivoa.net/vospace/core#type"
;
// the nature or genre of the resource
public
static
String
getProperty
(
Node
node
,
String
propertyName
)
{
for
(
Property
property
:
node
.
getProperties
())
{
if
(
property
.
getUri
().
equals
(
"ivo://ivoa.net/vospace/core#"
.
concat
(
propertyName
)))
{
return
property
.
getValue
();
}
}
return
null
;
}
// Returns all properties stored inside the node under the requested
// property URI.
public
static
List
<
String
>
getNodePropertyByURI
(
Node
node
,
String
propertyURI
)
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/it/inaf/oats/vospace/datamodel/NodeUtils.java
+
2
−
4
View file @
af9345e9
...
...
@@ -87,10 +87,9 @@ public class NodeUtils {
public
static
boolean
checkIfWritable
(
Node
myNode
,
String
userName
,
List
<
String
>
userGroups
)
{
// First check if parent node creator is == userid
List
<
String
>
nodeOwner
=
NodeProperties
.
getNodePropertyByURI
(
myNode
,
NodeProperties
.
CREATOR_URI
);
//= getNodePropertyByURI(
// toBeDeletedNode, "ivo://ivoa.net/vospace/core#creator");
if
(
nodeOwner
==
null
...
...
@@ -125,7 +124,6 @@ public class NodeUtils {
}
// DUPLICATED code from CreateNodeController - END
return
true
;
}
...
...
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