Loading src/main/java/it/inaf/oats/vospace/UriService.java +10 −11 Original line number Original line Diff line number Diff line Loading @@ -130,9 +130,9 @@ public class UriService { Protocol protocol = new Protocol(); Protocol protocol = new Protocol(); protocol.setUri(p.getUri()); protocol.setUri(p.getUri()); protocol.setEndpoint(endpoint); protocol.setEndpoint(endpoint); return protocol; return protocol; } else { } else { return null; return null; } } }).filter(Objects::nonNull) }).filter(Objects::nonNull) .collect(Collectors.toList()); .collect(Collectors.toList()); Loading Loading @@ -224,6 +224,10 @@ public class UriService { if (isLinkNode) { if (isLinkNode) { endpoint = ((LinkNode) node).getTarget(); endpoint = ((LinkNode) node).getTarget(); String linkTarget = ((LinkNode) node).getTarget(); if (linkedServiceDAO.isLinkedServiceUrl(linkTarget)) { endpoint += "&token=" + getEndpointToken(linkTarget); } } else { } else { Location location = locationDAO.getNodeLocation(relativePath).orElse(null); Location location = locationDAO.getNodeLocation(relativePath).orElse(null); Loading @@ -238,17 +242,12 @@ public class UriService { } else { } else { endpoint = fileServiceUrl + urlEncodePath(relativePath); endpoint = fileServiceUrl + urlEncodePath(relativePath); } } } endpoint += "?jobId=" + job.getJobId(); endpoint += "?jobId=" + job.getJobId(); if (isLinkNode) { if (!"true".equals(NodeProperties.getNodePropertyByURI(node, NodeProperties.PUBLIC_READ_URI))) { String linkTarget = ((LinkNode) node).getTarget(); endpoint += "&token=" + getEndpointToken(fileServiceUrl + relativePath); if (linkedServiceDAO.isLinkedServiceUrl(linkTarget)) { endpoint += "&token=" + getEndpointToken(linkTarget); } } } else if (!"true".equals(NodeProperties.getNodePropertyByURI(node, NodeProperties.PUBLIC_READ_URI))) { endpoint += "&token=" + getEndpointToken(fileServiceUrl + relativePath); } } return endpoint; return endpoint; Loading Loading @@ -364,7 +363,7 @@ public class UriService { return this.uri; return this.uri; } } public boolean isEndpointCompliant(String endpoint) { public boolean isEndpointCompliant(String endpoint) { return endpoint.toLowerCase() return endpoint.toLowerCase() .startsWith(this.protocolString + "://"); .startsWith(this.protocolString + "://"); } } Loading Loading
src/main/java/it/inaf/oats/vospace/UriService.java +10 −11 Original line number Original line Diff line number Diff line Loading @@ -130,9 +130,9 @@ public class UriService { Protocol protocol = new Protocol(); Protocol protocol = new Protocol(); protocol.setUri(p.getUri()); protocol.setUri(p.getUri()); protocol.setEndpoint(endpoint); protocol.setEndpoint(endpoint); return protocol; return protocol; } else { } else { return null; return null; } } }).filter(Objects::nonNull) }).filter(Objects::nonNull) .collect(Collectors.toList()); .collect(Collectors.toList()); Loading Loading @@ -224,6 +224,10 @@ public class UriService { if (isLinkNode) { if (isLinkNode) { endpoint = ((LinkNode) node).getTarget(); endpoint = ((LinkNode) node).getTarget(); String linkTarget = ((LinkNode) node).getTarget(); if (linkedServiceDAO.isLinkedServiceUrl(linkTarget)) { endpoint += "&token=" + getEndpointToken(linkTarget); } } else { } else { Location location = locationDAO.getNodeLocation(relativePath).orElse(null); Location location = locationDAO.getNodeLocation(relativePath).orElse(null); Loading @@ -238,17 +242,12 @@ public class UriService { } else { } else { endpoint = fileServiceUrl + urlEncodePath(relativePath); endpoint = fileServiceUrl + urlEncodePath(relativePath); } } } endpoint += "?jobId=" + job.getJobId(); endpoint += "?jobId=" + job.getJobId(); if (isLinkNode) { if (!"true".equals(NodeProperties.getNodePropertyByURI(node, NodeProperties.PUBLIC_READ_URI))) { String linkTarget = ((LinkNode) node).getTarget(); endpoint += "&token=" + getEndpointToken(fileServiceUrl + relativePath); if (linkedServiceDAO.isLinkedServiceUrl(linkTarget)) { endpoint += "&token=" + getEndpointToken(linkTarget); } } } else if (!"true".equals(NodeProperties.getNodePropertyByURI(node, NodeProperties.PUBLIC_READ_URI))) { endpoint += "&token=" + getEndpointToken(fileServiceUrl + relativePath); } } return endpoint; return endpoint; Loading Loading @@ -364,7 +363,7 @@ public class UriService { return this.uri; return this.uri; } } public boolean isEndpointCompliant(String endpoint) { public boolean isEndpointCompliant(String endpoint) { return endpoint.toLowerCase() return endpoint.toLowerCase() .startsWith(this.protocolString + "://"); .startsWith(this.protocolString + "://"); } } Loading