public class SimpleCompoundExtractorService extends java.lang.Object implements CompoundExtractor
| Modifier and Type | Field and Description |
|---|---|
protected java.nio.charset.Charset |
_charset
encoding.
|
protected Log |
_log
log.
|
protected MimeTypeIdentifier |
_mimeTypeIdentifier
mime type identifier service.
|
protected static java.lang.String |
APPLICATION_ZIP
mime type for ZIP.
|
protected static java.lang.String |
KEY_TMP_FILE_NAME
key for temporary file name.
|
protected static java.util.Collection<java.lang.String> |
SUPPORTED_MIME_TYPES
mime types for ZIP and GZIP.
|
KEY_COMMENT, KEY_COMPOUNDS, KEY_COMPRESSED_SIZE, KEY_FILE_NAME, KEY_IS_COMPOUND, KEY_IS_ROOT_COMPOUND_RECORD, KEY_SIZE, KEY_TIME| Constructor and Description |
|---|
SimpleCompoundExtractorService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate()
service activation.
|
boolean |
canExtract(java.io.File file)
Can the file be extracted by the CompoundExtractor service?
|
boolean |
canExtract(java.lang.String fileName,
java.lang.String mimeType)
check if we can handle this.
|
boolean |
canExtract(java.net.URL url,
java.lang.String mimeType)
Can the file be extracted by the CompoundExtractor service?
|
protected void |
deactivate()
service deactivation.
|
java.util.Iterator<Record> |
extract(java.io.InputStream compoundInputStream,
java.lang.String fileName,
java.lang.String contentAttachmentName)
Extract the compounds (recursively) and return an iterator over the resulting records that have been created from
the extracted compound.
|
java.util.Iterator<Record> |
extract(java.io.InputStream compoundInputStream,
java.lang.String fileName,
java.lang.String mimeType,
java.lang.String contentAttachmentName)
Extract the compounds (recursively) and return an iterator over the resulting records that have been created from
the extracted compound.
|
void |
setMimeTypeIdentifier(MimeTypeIdentifier mimeTypeIdentifier) |
void |
unsetMimeTypeIdentifier(MimeTypeIdentifier mimeTypeIdentifier) |
protected static final java.lang.String APPLICATION_ZIP
protected static final java.util.Collection<java.lang.String> SUPPORTED_MIME_TYPES
protected static final java.lang.String KEY_TMP_FILE_NAME
protected MimeTypeIdentifier _mimeTypeIdentifier
protected final Log _log
protected java.nio.charset.Charset _charset
protected void activate()
protected void deactivate()
public boolean canExtract(java.io.File file)
true result does not guarantee, that the file may be
extracted without any exceptions.canExtract in interface CompoundExtractorfile - the file in question.true if the given file can be extracted, false if not.public boolean canExtract(java.net.URL url,
java.lang.String mimeType)
true result does not
guarantee, that the file may be extracted without any exceptions.canExtract in interface CompoundExtractorurl - URL in questionmimeType - mimetype (if any could be determined)public boolean canExtract(java.lang.String fileName,
java.lang.String mimeType)
canExtract in interface CompoundExtractorfileName - the name of the file in question.mimeType - mimetype (if any could be determined)public java.util.Iterator<Record> extract(java.io.InputStream compoundInputStream, java.lang.String fileName, java.lang.String contentAttachmentName) throws CompoundExtractorException
extract in interface CompoundExtractorcompoundInputStream - the input stream of the compound object.fileName - the name of the file in question.contentAttachmentName - name of attachment to store content of extracted elements in.CompoundExtractorExceptionpublic java.util.Iterator<Record> extract(java.io.InputStream compoundInputStream, java.lang.String fileName, java.lang.String mimeType, java.lang.String contentAttachmentName) throws CompoundExtractorException
extract in interface CompoundExtractorcompoundInputStream - the input stream of the compound object.fileName - the name of the file in question.mimeType - mimetype (if any could be determined)contentAttachmentName - name of attachment to store content of extracted elements in.CompoundExtractorExceptionpublic void setMimeTypeIdentifier(MimeTypeIdentifier mimeTypeIdentifier)
mimeTypeIdentifier - the mimeTypeIdentifier to setpublic void unsetMimeTypeIdentifier(MimeTypeIdentifier mimeTypeIdentifier)
mimeTypeIdentifier - the mimeTypeIdentifier to set