Skip to content

Commit

Permalink
allow dspace canvas and image manifest be generated with empty subpath
Browse files Browse the repository at this point in the history
  • Loading branch information
wwelling committed May 25, 2018
1 parent 0170cab commit aa433ca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public String generateManifest(String path) throws IOException, URISyntaxExcepti
String handle = extractHandle(path);
RdfResource rdfResource = getDSpaceRdfModel(handle);
String url = rdfResource.getResource().getURI();
Canvas canvas = generateCanvas(new RdfResource(rdfResource, url.replace("rdf/handle", dspaceWebapp + "/bitstream").replaceAll(handle, path)));
Canvas canvas = generateCanvas(new RdfResource(rdfResource, url.replace("rdf/handle", dspaceWebapp != null && dspaceWebapp.length() > 0 ? dspaceWebapp + "/bitstream" : "bitstream").replaceAll(handle, path)));
return mapper.writeValueAsString(canvas);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class DSpaceImageManifestService extends AbstractDSpaceManifestService {

public String generateManifest(String path) throws IOException, URISyntaxException {
String dspacePath = joinPath(dspaceUrl, dspaceWebapp, "bitstream", path);
String dspacePath = dspaceWebapp != null && dspaceWebapp.length() > 0 ? joinPath(dspaceUrl, dspaceWebapp, "bitstream", path) : joinPath(dspaceUrl, "bitstream", path);
URI uri = getImageUri(dspacePath);
return fetchImageInfo(uri.toString());
}
Expand Down

0 comments on commit aa433ca

Please sign in to comment.