public class NuxeoArchiveReader extends AbstractDocumentReader
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.
Modifier | Constructor and Description |
---|---|
|
NuxeoArchiveReader(File file)
Create a
NuxeoArchiveReader from a File . |
|
NuxeoArchiveReader(InputStream in)
Create a
NuxeoArchiveReader from an InputStream . |
protected |
NuxeoArchiveReader(ZipInputStream in,
boolean checkMarker)
Protected constructor used by
ZipReader . |
Modifier and Type | Method and Description |
---|---|
protected void |
buildOrderedZipIndex() |
void |
close()
Closes the reader.
|
static boolean |
isMarkerEntry(ZipEntry entry) |
ExportedDocument |
read()
Reads a single document.
|
protected ExportedDocument |
readOrderedStream() |
protected ExportedDocument |
readZip() |
read
public NuxeoArchiveReader(InputStream in) throws IOException
NuxeoArchiveReader
from an InputStream
.
The InputStream must point to an archive that was generated by NuxeoArchiveWriter
.
in
- InputStream pointing an archive that was generated by NuxeoArchiveWriterIOException
protected NuxeoArchiveReader(ZipInputStream in, boolean checkMarker) throws IOException
ZipReader
. Must not close the stream when done.IOException
public NuxeoArchiveReader(File file) throws IOException
NuxeoArchiveReader
from a File
.
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.
file
- a Zip archiveIOException
protected void buildOrderedZipIndex()
public ExportedDocument read() throws IOException
DocumentReader
read
in interface DocumentReader
read
in class AbstractDocumentReader
IOException
protected ExportedDocument readZip() throws IOException
IOException
protected ExportedDocument readOrderedStream() throws IOException
IOException
public void close()
DocumentReader
public static boolean isMarkerEntry(ZipEntry entry)
Copyright © 2015 Nuxeo SA. All rights reserved.