|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mycore.common.events.MCREventHandlerBase
org.mycore.datamodel.ifs.extractors.MCRDataExtractor
public abstract class MCRDataExtractor
Event handler that extracts data like technical metadata (ID3 from MP3, EXIF from JPEG etc.) whenever an MCRFile's content is changed. The extracted data is stored in MCRFile's additional xml data.
org.mycore.datamodel.ifs.MCRFilesystemNode#getAdditionalData()| Constructor Summary | |
|---|---|
MCRDataExtractor()
|
|
| Method Summary | |
|---|---|
protected void |
addDataValue(Element parent,
String name,
String value)
Adds extracted metadata value to the resulting XML output, if it is not null or empty. |
protected abstract void |
extractData(Element container,
InputStream in)
Extracts metadata from a file. |
protected abstract String |
getSupportedContentTypeIDs()
Returns the IDs of the FileContentTypes that are supported by this metadata extractor. |
protected void |
handleFileCreated(MCREvent evt,
MCRFile file)
Handles file created events. |
protected void |
handleFileUpdated(MCREvent evt,
MCRFile file)
Handles file updated events. |
protected String |
outputData(Element data)
Returns the XML data element as a String |
protected void |
testLocalFile(String filePath)
Convenience method that prints out extracted data of a local file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MCRDataExtractor()
| Method Detail |
|---|
protected void testLocalFile(String filePath)
filePath - the path of the file to be testedprotected String outputData(Element data)
data - the extracted data as XML element
protected void handleFileCreated(MCREvent evt,
MCRFile file)
MCREventHandlerBase
handleFileCreated in class MCREventHandlerBaseevt - the event that occuredfile - the MCRFile that caused the event
protected void handleFileUpdated(MCREvent evt,
MCRFile file)
MCREventHandlerBase
handleFileUpdated in class MCREventHandlerBaseevt - the event that occuredfile - the MCRFile that caused the event
protected abstract void extractData(Element container,
InputStream in)
throws Exception
container - empty XML element that the extractor should fill with datain - the InputStream to read the file's content from
Exceptionprotected abstract String getSupportedContentTypeIDs()
protected void addDataValue(Element parent,
String name,
String value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||