NIHVIVO-1835 Guard against a File Bytestream individual whose AliasURL is the same as its URI.
This commit is contained in:
parent
8c016eaf39
commit
5db1494e85
2 changed files with 16 additions and 2 deletions
|
@ -505,7 +505,14 @@ public class EntityController extends VitroHttpServlet {
|
||||||
|
|
||||||
String url = fileInfo.getBytestreamAliasUrl();
|
String url = fileInfo.getBytestreamAliasUrl();
|
||||||
log.debug("Alias URL for '" + entity.getURI() + "' is '" + url + "'");
|
log.debug("Alias URL for '" + entity.getURI() + "' is '" + url + "'");
|
||||||
return url;
|
|
||||||
|
if (entity.getURI().equals(url)) {
|
||||||
|
// Avoid a tight loop; if the alias URL is equal to the URI, then
|
||||||
|
// don't recognize it as a File Bytestream.
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Model getRDF(Individual entity, OntModel contextModel, Model newModel, int recurseDepth ) {
|
private Model getRDF(Individual entity, OntModel contextModel, Model newModel, int recurseDepth ) {
|
||||||
|
|
|
@ -536,7 +536,14 @@ public class IndividualController extends FreemarkerHttpServlet {
|
||||||
|
|
||||||
String url = fileInfo.getBytestreamAliasUrl();
|
String url = fileInfo.getBytestreamAliasUrl();
|
||||||
log.debug("Alias URL for '" + entity.getURI() + "' is '" + url + "'");
|
log.debug("Alias URL for '" + entity.getURI() + "' is '" + url + "'");
|
||||||
return url;
|
|
||||||
|
if (entity.getURI().equals(url)) {
|
||||||
|
// Avoid a tight loop; if the alias URL is equal to the URI, then
|
||||||
|
// don't recognize it as a File Bytestream.
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Model getRDF(Individual entity, OntModel contextModel, Model newModel, int recurseDepth ) {
|
private Model getRDF(Individual entity, OntModel contextModel, Model newModel, int recurseDepth ) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue