Loading src/main/java/it/inaf/oats/vospace/datamodel/NodeProperties.java +13 −0 Original line number Diff line number Diff line Loading @@ -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; /** * Loading Loading @@ -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) { Loading src/main/java/it/inaf/oats/vospace/datamodel/NodeUtils.java +2 −4 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -125,7 +124,6 @@ public class NodeUtils { } // DUPLICATED code from CreateNodeController - END return true; } Loading Loading
src/main/java/it/inaf/oats/vospace/datamodel/NodeProperties.java +13 −0 Original line number Diff line number Diff line Loading @@ -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; /** * Loading Loading @@ -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) { Loading
src/main/java/it/inaf/oats/vospace/datamodel/NodeUtils.java +2 −4 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -125,7 +124,6 @@ public class NodeUtils { } // DUPLICATED code from CreateNodeController - END return true; } Loading