NIHVIVO-1835 Guard against a File Bytestream individual whose AliasURL is the same as its URI.

This commit is contained in:
jeb228 2011-01-24 21:40:08 +00:00
parent 8c016eaf39
commit 5db1494e85
2 changed files with 16 additions and 2 deletions

View file

@ -505,8 +505,15 @@ public class EntityController extends VitroHttpServlet {
String url = fileInfo.getBytestreamAliasUrl();
log.debug("Alias URL for '" + entity.getURI() + "' is '" + 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 ) {
Resource subj = newModel.getResource(entity.getURI());

View file

@ -536,8 +536,15 @@ public class IndividualController extends FreemarkerHttpServlet {
String url = fileInfo.getBytestreamAliasUrl();
log.debug("Alias URL for '" + entity.getURI() + "' is '" + 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 ) {
Resource subj = newModel.getResource(entity.getURI());