Skip to content

Commit 9a2e172

Browse files
authored
Merge pull request #60 from spdx/dontdecode
Don't decode OBJECT URIs
2 parents 7ae1304 + 90c809e commit 9a2e172

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/main/java/org/spdx/spdxRdfStore/RdfSpdxModelManager.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ private Optional<Object> literalNodeToObject(Object literalValue, Property prope
824824
}
825825

826826
/**
827-
* Obtain an ID from a resource
827+
* Obtain an ObjectUri from a resource
828828
* @param resource
829829
* @return ID formatted appropriately for use outside the RdfStore
830830
* @throws SpdxRdfException
@@ -834,12 +834,7 @@ private String resourceToObjectUri(Resource resource) throws SpdxRdfException {
834834
if (resource.isAnon()) {
835835
return RdfStore.ANON_PREFIX + resource.getId();
836836
} else if (resource.isURIResource()) {
837-
try {
838-
return URLDecoder.decode(resource.getURI(), StandardCharsets.UTF_8.name());
839-
} catch (UnsupportedEncodingException e) {
840-
logger.error("Unexpected URL decoding error for: "+resource.toString());
841-
return resource.getURI();
842-
}
837+
return resource.getURI();
843838
} else {
844839
logger.error("Attempting to convert unsupported resource type to an ID: "+resource.toString());
845840
throw new SpdxRdfException("Only anonymous and URI resources can be converted to an ID");

0 commit comments

Comments
 (0)