use of com.android.mms.dom.smil.parser.SmilXmlParser in project qksms by moezbhatti.
the class SmilHelper method getSmilDocument.
/**
* Parse SMIL message and retrieve SMILDocument.
*
* @return A SMILDocument or null if parsing failed.
*/
private static SMILDocument getSmilDocument(PduPart smilPart) {
try {
byte[] data = smilPart.getData();
if (data != null) {
if (LOCAL_LOGV) {
Log.v(TAG, "Parsing SMIL document.");
Log.v(TAG, new String(data));
}
ByteArrayInputStream bais = new ByteArrayInputStream(data);
SMILDocument document = new SmilXmlParser().parse(bais);
return validate(document);
}
} catch (IOException e) {
Log.e(TAG, "Failed to parse SMIL document.", e);
} catch (SAXException e) {
Log.e(TAG, "Failed to parse SMIL document.", e);
} catch (MmsException e) {
Log.e(TAG, "Failed to parse SMIL document.", e);
}
return null;
}
use of com.android.mms.dom.smil.parser.SmilXmlParser in project android-aosp-mms by slvn.
the class SmilHelper method getSmilDocument.
/**
* Parse SMIL message and retrieve SMILDocument.
*
* @return A SMILDocument or null if parsing failed.
*/
private static SMILDocument getSmilDocument(PduPart smilPart) {
try {
byte[] data = smilPart.getData();
if (data != null) {
if (LOCAL_LOGV) {
Log.v(TAG, "Parsing SMIL document.");
Log.v(TAG, new String(data));
}
ByteArrayInputStream bais = new ByteArrayInputStream(data);
SMILDocument document = new SmilXmlParser().parse(bais);
return validate(document);
}
} catch (IOException e) {
Log.e(TAG, "Failed to parse SMIL document.", e);
} catch (SAXException e) {
Log.e(TAG, "Failed to parse SMIL document.", e);
} catch (MmsException e) {
Log.e(TAG, "Failed to parse SMIL document.", e);
}
return null;
}
use of com.android.mms.dom.smil.parser.SmilXmlParser in project opencast by opencast.
the class PartialImportWorkflowOperationHandler method getSmilDocument.
/**
* Get the SMIL document from a catalog.
*/
private SMILDocument getSmilDocument(final Catalog smilCatalog) throws WorkflowOperationException {
FileInputStream in = null;
try {
File smilXmlFile = workspace.get(smilCatalog.getURI());
SmilXmlParser smilParser = new SmilXmlParser();
in = new FileInputStream(smilXmlFile);
return smilParser.parse(in);
} catch (Exception e) {
logger.error("Unable to parse smil catalog {}! {}", smilCatalog.getURI(), e);
throw new WorkflowOperationException(e);
} finally {
IOUtils.closeQuietly(in);
}
}
Aggregations