Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
VOSpace INAF
vospace-datamodel
Commits
af9345e9
Commit
af9345e9
authored
Feb 03, 2021
by
Sara Bertocco
Browse files
Working on task #3635 - Refactoring: create NodeUtils class
parent
5c4d42c2
Pipeline
#959
passed with stages
in 32 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/it/inaf/oats/vospace/datamodel/NodeProperties.java
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
)
{
...
...
src/main/java/it/inaf/oats/vospace/datamodel/NodeUtils.java
View file @
af9345e9
...
...
@@ -87,11 +87,10 @@ 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
||
nodeOwner
.
isEmpty
()
...
...
@@ -125,7 +124,6 @@ public class NodeUtils {
}
// DUPLICATED code from CreateNodeController - END
return
true
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment