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
ModifierConstructorDescriptionNuxeoArchiveReader
(File file) Create aNuxeoArchiveReader
from aFile
.Create aNuxeoArchiveReader
from anInputStream
.protected
NuxeoArchiveReader
(ZipInputStream in, boolean checkMarker) Protected constructor used byZipReader
. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
close()
Closes the reader.protected void
fillExportedDocument
(ExportedDocument xdoc, ZipEntry entry) static boolean
isMarkerEntry
(ZipEntry entry) read()
Reads a single document.protected ExportedDocument
protected ExportedDocument
readZip()
Methods inherited from class org.nuxeo.ecm.core.io.impl.AbstractDocumentReader
read
-
Constructor Details
-
NuxeoArchiveReader
Create aNuxeoArchiveReader
from 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 aNuxeoArchiveReader
from 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:DocumentReader
Reads a single document.- Specified by:
read
in interfaceDocumentReader
- Specified by:
read
in 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:DocumentReader
Closes the reader. -
isMarkerEntry
-