NIHVIVO-3654 Add more error checking for invalid RDF on the image.
This commit is contained in:
parent
088b26cf84
commit
c39790aed9
1 changed files with 13 additions and 0 deletions
|
@ -94,6 +94,7 @@ public class FileInfo {
|
|||
String filename = surrogate.getDataValue(VitroVocabulary.FS_FILENAME);
|
||||
if (filename == null) {
|
||||
log.error("File had no filename: '" + uri + "'");
|
||||
return null;
|
||||
} else {
|
||||
log.debug("Filename for '" + uri + "' was '" + filename + "'");
|
||||
}
|
||||
|
@ -101,6 +102,7 @@ public class FileInfo {
|
|||
String mimeType = surrogate.getDataValue(VitroVocabulary.FS_MIME_TYPE);
|
||||
if (mimeType == null) {
|
||||
log.error("File had no mimeType: '" + uri + "'");
|
||||
return null;
|
||||
} else {
|
||||
log.debug("mimeType for '" + uri + "' was '" + mimeType + "'");
|
||||
}
|
||||
|
@ -110,10 +112,21 @@ public class FileInfo {
|
|||
if (byteStream == null) {
|
||||
log.error("File surrogate '" + uri
|
||||
+ "' had no associated bytestream.");
|
||||
return null;
|
||||
}
|
||||
|
||||
String bytestreamUri = findBytestreamUri(byteStream, uri);
|
||||
if (bytestreamUri == null) {
|
||||
log.error("Bytestream of file surrogate '" + uri + "' had no URI: "
|
||||
+ byteStream);
|
||||
return null;
|
||||
}
|
||||
|
||||
String bytestreamAliasUrl = findBytestreamAliasUrl(byteStream, uri);
|
||||
if (bytestreamAliasUrl == null) {
|
||||
log.error("Bytestream '" + bytestreamUri + "' had no alias URL.");
|
||||
return null;
|
||||
}
|
||||
|
||||
return new FileInfo.Builder().setUri(uri).setFilename(filename)
|
||||
.setMimeType(mimeType).setBytestreamUri(bytestreamUri)
|
||||
|
|
Loading…
Add table
Reference in a new issue