Jump to: navigation, search


< SMILA‎ | Documentation
Revision as of 07:16, 20 February 2012 by Juergen.schumacher.attensity.com (Talk | contribs) (New page: == CompoundExtractor Service == Interface: <tt>org.eclipse.smila.importing.CompoundExtractor</tt> A CompoundExtractor service provides two kinds of methods: * check if an object's filena...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

CompoundExtractor Service

Interface: org.eclipse.smila.importing.CompoundExtractor

A CompoundExtractor service provides two kinds of methods:

  • check if an object's filename, URL or mimetype idenfifies it as a compound object that can be extracted by the service.
  • extract the compound: Given an InputStream with the compound content produce records for the elements.

The element records can contain the following attributes:

  • fileName: the complete name of the entry in the compound object, usually something like a filesystem path
  • isCompound: true, if the element is a supported compound object itself.
  • size: uncompressed size of the element
  • time: last modification timestamp, as a datetime value.
  • compounds: a sequence of the compound files to look into to reach this element. For example, if the compound /data/compound.zip contains a file archived/subcompound.zip which contain a file x.html, the compounds list for x.html would be
    [/data/compound.zip, archived/subcompound.zip]</tt>.
* <tt>compressedSize</tt>: compressed size of the element * <tt>comment</tt>: a comment for the element in the compound (if supported by the compound type) * <tt>isRootCompound</tt>: set to <tt>true</tt> if the record describes the processed compound object itself. == SimpleCompoundExtractorService == Bundle: <tt>org.eclipse.smila.importing.compounds.simple</tt> This extractor service uses the classes provided by the JDK's <tt>java.util.zip</tt> package to extract compound objects. This means that it can currently support ZIP files and GZ files (not TAR.GZ, though). Supported Mimetypes: * <tt>application/zip</tt> * <tt>application/x-gunzip</tt> * <tt>application/x-gzip</tt> If the mimetype is not provided by the caller at all or it is only <tt>application/octet-stream</tt> it uses the current [[SMILA/Documentation/MimeTypeIdentifier|MimeType Identifier service]] to recognize the real mimetype from the filename extension. For ZIP files, it creates one record for the ZIP file itself and one record for each contained element. For GZ it creates one record with the original filename of the GZ file, but the uncompressed content.