Class ArchiveHandler
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.contentio.archive.ArchiveHandler
-
- All Implemented Interfaces:
LogEnabled,Component,Contextualizable,Serviceable
public class ArchiveHandler extends AbstractLogEnabled implements Component, Serviceable, Contextualizable
Archive data on disk.
-
-
Constructor Summary
Constructors Constructor Description ArchiveHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontextualize(Context context)voidexport(File output)Exports withArchiverExtensionPointmechanism into the givenFileFilegetArchiveFile(String name)Gets the archive fileStream<String>getArchiveFiles()Gets the archive filesPathgetArchiveFolder()Gets the folder containing all the managed archivesStream<PartialImport>getPartialImports(String archiveName)Gets the partial imports of the given archiveImportReportimportAll(File input, Merger merger)Imports all data from the given ZIP archiveImportReportpartialImport(File input, Collection<String> partialImports, Merger merger)Imports partial data from the given ZIP archivevoidservice(ServiceManager manager)-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
METADATA_PREFIX
public static final String METADATA_PREFIX
The prefix path for exporting metadata content- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ArchiveHandler
public ArchiveHandler()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
getArchiveFolder
public Path getArchiveFolder()
Gets the folder containing all the managed archives- Returns:
- the folder containing all the managed archives
-
getArchiveFiles
public Stream<String> getArchiveFiles()
Gets the archive files- Returns:
- the archive files
-
getArchiveFile
public File getArchiveFile(String name)
Gets the archive file- Parameters:
name- The archive name- Returns:
- the archive file
-
getPartialImports
public Stream<PartialImport> getPartialImports(String archiveName) throws IOException
Gets the partial imports of the given archive- Parameters:
archiveName- The archive name- Returns:
- the partial imports
- Throws:
IOException- if an I/O error occured
-
export
public void export(File output) throws IOException
Exports withArchiverExtensionPointmechanism into the givenFile- Parameters:
output- The output ZIP file- Throws:
IOException- if an IO exception occured
-
importAll
public ImportReport importAll(File input, Merger merger) throws IOException
Imports all data from the given ZIP archive- Parameters:
input- the ZIP archivemerger- theMerger- Returns:
- The
ImportReport - Throws:
IOException- if an I/O error occurs
-
partialImport
public ImportReport partialImport(File input, Collection<String> partialImports, Merger merger) throws IOException
Imports partial data from the given ZIP archive- Parameters:
input- the ZIP archivepartialImports- the partial importsmerger- theMerger- Returns:
- The
ImportReport - Throws:
IOException- if an I/O error occurs
-
-