Class NuxeoArchiveReader
java.lang.Object
org.nuxeo.ecm.core.io.impl.AbstractDocumentReader
org.nuxeo.ecm.core.io.impl.plugins.NuxeoArchiveReader
- All Implemented Interfaces:
DocumentReader
Reads nuxeo archives generated using
NuxeoArchiveWriter.
If you need to read a CoreIO XML Archive that was not directly generated by NuxeoArchiveWriter or that was
modified you need to use the NuxeoArchiveReader(File) constructor.
This implementation holds either a ZipInputStream, in which case it is assumed to have been generated by
NuxeoArchiveWriter and has a special format (TODO DOCUMENT), or it holds a ZipFile that may be used
in a random-access manner.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionNuxeoArchiveReader(File file) Create aNuxeoArchiveReaderfrom aFile.Create aNuxeoArchiveReaderfrom anInputStream.protectedNuxeoArchiveReader(ZipInputStream in, boolean checkMarker) Protected constructor used byZipReader. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidclose()Closes the reader.protected voidfillExportedDocument(ExportedDocument xdoc, ZipEntry entry) static booleanisMarkerEntry(ZipEntry entry) read()Reads a single document.protected ExportedDocumentprotected ExportedDocumentreadZip()Methods inherited from class org.nuxeo.ecm.core.io.impl.AbstractDocumentReader
read
-
Constructor Details
-
NuxeoArchiveReader
Create aNuxeoArchiveReaderfrom anInputStream.The InputStream must point to an archive that was generated by
NuxeoArchiveWriter.- Parameters:
in- InputStream pointing an archive that was generated by NuxeoArchiveWriter- Throws:
IOException
-
NuxeoArchiveReader
Protected constructor used byZipReader. Must not close the stream when done.- Throws:
IOException
-
NuxeoArchiveReader
Create aNuxeoArchiveReaderfrom aFile.This constructor is different from others because it allows the input zip file to have been generated by an other engine that
NuxeoArchiveWriter.In particular, you can use this constructor on a Zip Archive that was manually modified.
- Parameters:
file- a Zip archive- Throws:
IOException
-
-
Method Details
-
buildOrderedZipIndex
protected void buildOrderedZipIndex() -
read
Description copied from interface:DocumentReaderReads a single document.- Specified by:
readin interfaceDocumentReader- Specified by:
readin classAbstractDocumentReader- Returns:
- the document read or null if there are no more documents to read
- Throws:
IOException
-
readZip
- Throws:
IOException
-
readOrderedStream
- Throws:
IOException
-
fillExportedDocument
- Throws:
IOException
-
close
public void close()Description copied from interface:DocumentReaderCloses the reader. -
isMarkerEntry
-