Class ContentArchiver
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.contentio.archive.ContentArchiver
-
- All Implemented Interfaces:
Archiver,LogEnabled,Serviceable
public class ContentArchiver extends AbstractLogEnabled implements Archiver, Serviceable
Archives contents in /ametys:root/ametys:contents
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classContentArchiver.ContentArchiverManifestReaderWriter
-
Field Summary
Fields Modifier and Type Field Description private ContentsArchiverHelper_contentsArchiverHelperprivate ManifestReaderWriter_manifestReaderWriterprivate AmetysObjectResolver_resolverstatic StringIDArchiver id.
-
Constructor Summary
Constructors Constructor Description ContentArchiver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void_deleteBeforePartialImport(AmetysObjectCollection rootContents)private AmetysObjectCollection_rootContents()voidexport(ZipOutputStream zos)Export data into the destination archiveManifestReaderWritergetManifestReaderWriter()Get theManifestReaderWriterCollection<String>managedPartialImports(Collection<String> partialImports)Returns the partial imports, among the given ones, that thisArchiveris able to manage.ImportReportpartialImport(Path zipPath, Collection<String> partialImports, Merger merger, boolean deleteBefore)Import data (limited to the given partial imports) from the source archivevoidservice(ServiceManager manager)-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.contentio.archive.Archiver
additionalSuccessImportMail
-
-
-
-
Field Detail
-
ID
public static final String ID
Archiver id.- See Also:
- Constant Field Values
-
_resolver
private AmetysObjectResolver _resolver
-
_contentsArchiverHelper
private ContentsArchiverHelper _contentsArchiverHelper
-
_manifestReaderWriter
private ManifestReaderWriter _manifestReaderWriter
-
-
Constructor Detail
-
ContentArchiver
public ContentArchiver()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
getManifestReaderWriter
public ManifestReaderWriter getManifestReaderWriter()
Description copied from interface:ArchiverGet theManifestReaderWriter- Specified by:
getManifestReaderWriterin interfaceArchiver- Returns:
- the
ManifestReaderWriter
-
export
public void export(ZipOutputStream zos) throws IOException
Description copied from interface:ArchiverExport data into the destination archive- Specified by:
exportin interfaceArchiver- Parameters:
zos- the output data stream.- Throws:
IOException- if an error occurs while writing entries to the archive.
-
_rootContents
private AmetysObjectCollection _rootContents()
-
_deleteBeforePartialImport
private void _deleteBeforePartialImport(AmetysObjectCollection rootContents) throws IOException
- Throws:
IOException
-
managedPartialImports
public Collection<String> managedPartialImports(Collection<String> partialImports)
Description copied from interface:ArchiverReturns the partial imports, among the given ones, that thisArchiveris able to manage.- Specified by:
managedPartialImportsin interfaceArchiver- Parameters:
partialImports- The partial imports to filter- Returns:
- The managed partial imports
-
partialImport
public ImportReport partialImport(Path zipPath, Collection<String> partialImports, Merger merger, boolean deleteBefore) throws IOException
Description copied from interface:ArchiverImport data (limited to the given partial imports) from the source archive- Specified by:
partialImportin interfaceArchiver- Parameters:
zipPath- the input zip pathpartialImports- The partial imports to do. The passed collection must already be filtered out byArchiver.managedPartialImports(java.util.Collection<java.lang.String>)merger- TheMergerdeleteBefore-trueif objects need to be deleted before applying the partial imports- Returns:
- The
ImportReport - Throws:
IOException- if an error occurs while reading archive entries.
-
-