* ignore failed xattr read

This commit is contained in:
Reinhard Pointner 2014-11-12 17:39:57 +00:00
parent dc9f6f5d12
commit 8ba347f4f7
1 changed files with 9 additions and 5 deletions

View File

@ -405,11 +405,15 @@ public class MediaBindingBean {
} }
// try CRC32 xattr (as stored by verify script) // try CRC32 xattr (as stored by verify script)
try {
MetaAttributeView xattr = new MetaAttributeView(inferredMediaFile); MetaAttributeView xattr = new MetaAttributeView(inferredMediaFile);
checksum = xattr.get("CRC32"); checksum = xattr.get("CRC32");
if (checksum != null) { if (checksum != null) {
return checksum; return checksum;
} }
} catch (Exception e) {
// ignore if xattr metadata is not supported for the given file
}
// calculate checksum from file // calculate checksum from file
return crc32(inferredMediaFile); return crc32(inferredMediaFile);
@ -962,7 +966,7 @@ public class MediaBindingBean {
private String getOriginalFileName(File file) { private String getOriginalFileName(File file) {
try { try {
return new MetaAttributes(file).getOriginalName(); return new MetaAttributes(file).getOriginalName();
} catch (Throwable e) { } catch (Exception e) {
return null; return null;
} }
} }