Class ZipArchiveProvider

java.lang.Object
nl.knaw.dans.layerstore.ZipArchiveProvider
All Implemented Interfaces:
ArchiveProvider

public class ZipArchiveProvider extends Object implements ArchiveProvider
An ArchiveProvider that creates and reads ZIP archives.
  • Constructor Details

    • ZipArchiveProvider

      public ZipArchiveProvider(Path archiveRoot)
  • Method Details

    • createArchive

      public Archive createArchive(long layerId, boolean exists)
      Description copied from interface: ArchiveProvider
      Create a new Archive instance for the given layer ID.
      Specified by:
      createArchive in interface ArchiveProvider
      Parameters:
      layerId - the layer ID
      exists - the archive file already exists
      Returns:
      the new archive
    • exists

      public boolean exists(long layerId)
      Description copied from interface: ArchiveProvider
      Check if an archive exists at the given path.
      Specified by:
      exists in interface ArchiveProvider
      Parameters:
      layerId - the layer ID
      Returns:
      true if the archive exists, false otherwise
    • listLayerIds

      public List<Long> listLayerIds() throws IOException
      Description copied from interface: ArchiveProvider
      List all archived layer IDs.
      Specified by:
      listLayerIds in interface ArchiveProvider
      Returns:
      a list of layer IDs for which archives exist
      Throws:
      IOException
    • validateRoot

      public void validateRoot() throws IOException
      Description copied from interface: ArchiveProvider
      Verifies that the archive root contains only valid archives.
      Specified by:
      validateRoot in interface ArchiveProvider
      Throws:
      IOException