Package com.logicaldoc.impex
Class Index
- java.lang.Object
-
- com.logicaldoc.impex.Index
-
public class Index extends Object
This bean is used to write the archive's index file and to read all informations regarding all documents into the archive.- Since:
- 4.5
- Author:
- Matteo Caruso - LogicalDOC
-
-
Field Summary
Fields Modifier and Type Field Description static String
ARCHIVE_VERSION
-
Constructor Summary
Constructors Constructor Description Index(byte[] indexContent, IndexHandler handler)
Constructor used on the ArchiveVerifier class.Index(byte[] indexContent, IndexImportHandler handler)
Constructor used on the ArchiveImporter class.Index(Archive archive)
Index(File file)
Index(File file, IndexHandler handler)
Constructor used on the ArchiveVerifier class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Archive
getArchive()
String
getArchiveVersion()
static Long
getBarcodeTemplateId(String name)
static String
getBarcodeTemplateName(Long id)
long
getCount()
File
getFile()
static Long
getOcrTemplateId(String name)
static String
getOcrTemplateName(Long id)
String
getProgramVersion()
String
getSizedisplay()
void
marshall()
Writes the index file to index.xmlvoid
marshall(Writer writer)
Writes the index filevoid
setArchive(Archive archive)
void
unmarshall()
Reads the index from a filevoid
unmarshall(byte[] indexContent, IndexHandler dataHandler)
Reads the index from a stream and sets the archive attributes and each archive's version valuesvoid
unmarshall(IndexHandler dataHandler)
Reads the index from a filevoid
unmarshall(InputStream is, IndexHandler dataHandler)
Reads the index from a stream and sets the archive attributes and each archive's version values
-
-
-
Field Detail
-
ARCHIVE_VERSION
public static final String ARCHIVE_VERSION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Index
public Index(Archive archive)
-
Index
public Index(File file)
-
Index
public Index(byte[] indexContent, IndexHandler handler)
Constructor used on the ArchiveVerifier class. This method unmarshalls the index file stream- Parameters:
indexContent
- the bytes of the index filehandler
- the handler to be used to process the file
-
Index
public Index(File file, IndexHandler handler)
Constructor used on the ArchiveVerifier class. This method unmarshalls the index file- Parameters:
file
- the index.xml filehandler
- the handler to be used to process the file
-
Index
public Index(byte[] indexContent, IndexImportHandler handler)
Constructor used on the ArchiveImporter class. This method unmarshalls the index file stream and allows to get the archive's documents list- Parameters:
indexContent
- content of the index.xml filehandler
- the handler to be used to process the file
-
-
Method Detail
-
getFile
public File getFile()
-
marshall
public void marshall() throws IOException, com.logicaldoc.core.PersistenceException
Writes the index file to index.xml- Throws:
IOException
- Raised on disk errorscom.logicaldoc.core.PersistenceException
- error in the database
-
marshall
public void marshall(Writer writer) throws IOException, com.logicaldoc.core.PersistenceException
Writes the index file- Parameters:
writer
- The writer to write to- Throws:
IOException
- Raised on disk errorscom.logicaldoc.core.PersistenceException
- error in the database
-
unmarshall
public void unmarshall()
Reads the index from a file
-
unmarshall
public void unmarshall(IndexHandler dataHandler)
Reads the index from a file- Parameters:
dataHandler
- the handler to be used to process the file
-
unmarshall
public void unmarshall(byte[] indexContent, IndexHandler dataHandler)
Reads the index from a stream and sets the archive attributes and each archive's version values- Parameters:
indexContent
- content of the index filedataHandler
- the handler to be used to process the file
-
unmarshall
public void unmarshall(InputStream is, IndexHandler dataHandler)
Reads the index from a stream and sets the archive attributes and each archive's version values- Parameters:
is
- the stream to read the index file contentdataHandler
- the handler to be used to process the file
-
getArchive
public Archive getArchive()
-
setArchive
public void setArchive(Archive archive)
-
getCount
public long getCount()
-
getSizedisplay
public String getSizedisplay()
-
getProgramVersion
public String getProgramVersion()
-
getArchiveVersion
public String getArchiveVersion()
-
-