Package com.logicaldoc.impex
Class ArchiveManager
java.lang.Object
com.logicaldoc.impex.ArchiveManager
Manager for archive operations handling
- Since:
- 4.5
- Author:
- Matteo Caruso - LogicalDOC
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaddEntry(Archive archive, com.logicaldoc.core.document.Version version, com.logicaldoc.core.security.user.User user, String sid) Adds a new entry taking care of locking the document, a default comment will be used, the archive does not get stored in the DB.booleanaddEntry(Archive archive, com.logicaldoc.core.document.Version version, com.logicaldoc.core.security.user.User user, String comment, String sid) Adds a new entry taking care of locking the document, the archive does not get stored in the DB.voidcloseArchive(long id, com.logicaldoc.core.security.user.User user) voidDelete the archive with the given id and unlocks all its document.getArchiveDirectory(int mode, String archiveName, String id, long tenantId) getArchiveDirectory(int mode, String archiveName, String id, String tenantName) Retrieves the archive directory from/in which will be import/copied the archive's documentsgetArchiveDirectory(Archive archive) Retrieves the archive directory from/in which will be import/copied the archive's documentvoidwriteHtmlIndex(Archive archive) Writes the index.html file.voidwriteIndex(Archive archive) Writes the XML and CSV index files for the archive.voidwriteIndex(Archive archive, Writer writer) Writes the XML index file for the archive in the specified writer
- 
Constructor Details- 
ArchiveManagerpublic ArchiveManager()
 
- 
- 
Method Details- 
getArchiveDirectoryRetrieves the archive directory from/in which will be import/copied the archive's document- Parameters:
- archive- the archive
- Returns:
- the directory that contains the archive
- Throws:
- com.logicaldoc.core.PersistenceException- Error in the data layer
 
- 
getArchiveDirectorypublic File getArchiveDirectory(int mode, String archiveName, String id, long tenantId) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
- 
getArchiveDirectoryRetrieves the archive directory from/in which will be import/copied the archive's documents- Parameters:
- mode- The mode Import or Export of an archive
- archiveName- name of the archive
- id- identifier of the archive
- tenantName- name of the tenant
- Returns:
- the directory that contains the archive
 
- 
writeIndexpublic void writeIndex(Archive archive) throws IOException, com.logicaldoc.core.PersistenceException Writes the XML and CSV index files for the archive. Initially the file is named "index.xml.tmp". When the creation operation is successfully completed, the file is renamed as "index.xml".- Parameters:
- archive- the archive to use for writing the index.xml
- Throws:
- IOException- cannot write the index.xml
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
writeIndexpublic void writeIndex(Archive archive, Writer writer) throws IOException, com.logicaldoc.core.PersistenceException Writes the XML index file for the archive in the specified writer- Parameters:
- archive- the archive to write
- writer- the writer for the index.xml
- Throws:
- IOException- cannot write the index.xml
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
writeHtmlIndexWrites the index.html file. Make sure to pass an initialized archive- Parameters:
- archive- the archive to write as HTML
- Throws:
- IOException- cannot write the HTML index file
 
- 
addEntrypublic boolean addEntry(Archive archive, com.logicaldoc.core.document.Version version, com.logicaldoc.core.security.user.User user, String sid) Adds a new entry taking care of locking the document, a default comment will be used, the archive does not get stored in the DB.- Parameters:
- archive- the archive to alter
- version- the version to add to the archive
- user- the current user
- sid- identifier of the session
- Returns:
- if the entry has been successfully added
 
- 
addEntrypublic boolean addEntry(Archive archive, com.logicaldoc.core.document.Version version, com.logicaldoc.core.security.user.User user, String comment, String sid) Adds a new entry taking care of locking the document, the archive does not get stored in the DB.- Parameters:
- archive- the archive to alter
- version- the version to add to the archive
- user- the current user
- comment- an optional comment
- sid- identifier of the session
- Returns:
- if the entry has been successfully added
 
- 
deletepublic void delete(long archiveId, com.logicaldoc.core.security.user.User user, String comment) throws com.logicaldoc.core.PersistenceException Delete the archive with the given id and unlocks all its document.- Parameters:
- archiveId- The id of the archive to delete
- user- The user that makes the deleting operation
- comment- an optional comment to the deletion
- Throws:
- com.logicaldoc.core.PersistenceException- error at data layer
 
- 
closeArchivepublic void closeArchive(long id, com.logicaldoc.core.security.user.User user) throws com.logicaldoc.core.PersistenceException - Throws:
- com.logicaldoc.core.PersistenceException
 
 
-