}
@Override
public FileConversionMetaData getFileMetaData(File file) {
FileConversionMetaData result = new FileConversionMetaData();
try {
SystemFile sf = SystemFile.getSystemFile(file);
String mimeType = sf.getMimeType();
String mimeEncoding = sf.getMimeEncoding();
// Is it a known MIME type?
MultimediaClass aClass = MimeUtils.getMultimediaClassFromMimeType(sf.getMimeType());
if( MultimediaClass.AUDIO == aClass
|| MultimediaClass.VIDEO == aClass
|| MultimediaClass.IMAGE == aClass
) {
String fileClass = aClass.getValue();
result.setMimeType(mimeType);
result.setMimeEncoding(mimeEncoding);
result.setFileClass(fileClass);
result.setFileConvertable(true);
}
} catch(Exception e) {
// Ignore
}