Class ArchiveOnDisk
- java.lang.Object
-
- app.coronawarn.server.services.distribution.assembly.structure.WritableOnDisk
-
- app.coronawarn.server.services.distribution.assembly.structure.file.FileOnDisk
-
- app.coronawarn.server.services.distribution.assembly.structure.file.FileOnDiskWithChecksum
-
- app.coronawarn.server.services.distribution.assembly.structure.archive.ArchiveOnDisk
-
- All Implemented Interfaces:
Archive<WritableOnDisk>,Directory<WritableOnDisk>,File<WritableOnDisk>,Writable<WritableOnDisk>
public class ArchiveOnDisk extends FileOnDiskWithChecksum implements Archive<WritableOnDisk>
AnArchivethat can be written to disk as a ZIP archive.
-
-
Field Summary
-
Fields inherited from class app.coronawarn.server.services.distribution.assembly.structure.file.FileOnDiskWithChecksum
CHECKSUM_FILE_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description ArchiveOnDisk(String name)Constructs anArchivewith an internal, temporary directory to store writables in.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWritable(Writable<WritableOnDisk> writable)byte[]getBytes()Returns the bytes contained by thisFile.protected byte[]getBytesForChecksum()Fetches the target bytes for computation of the checksum.Set<Writable<WritableOnDisk>>getWritables()voidprepare(ImmutableStack<Object> indices)Does nothing.voidsetBytes(byte[] bytes)Sets the bytes to be contained by thisFile.voidsetParent(Directory<WritableOnDisk> parent)Sets the parent of thisWritable.-
Methods inherited from class app.coronawarn.server.services.distribution.assembly.structure.file.FileOnDiskWithChecksum
buildChecksumPathForFile, isChecksumFile, write
-
Methods inherited from class app.coronawarn.server.services.distribution.assembly.structure.file.FileOnDisk
getRoot
-
Methods inherited from class app.coronawarn.server.services.distribution.assembly.structure.WritableOnDisk
getFileOnDisk, getName, getParent, isArchive, isDirectory, isFile
-
-
-
-
Method Detail
-
setParent
public void setParent(Directory<WritableOnDisk> parent)
Description copied from interface:WritableSets the parent of thisWritable.- Specified by:
setParentin interfaceWritable<WritableOnDisk>- Overrides:
setParentin classWritableOnDisk
-
addWritable
public void addWritable(Writable<WritableOnDisk> writable)
Description copied from interface:Directory- Specified by:
addWritablein interfaceDirectory<WritableOnDisk>
-
getWritables
public Set<Writable<WritableOnDisk>> getWritables()
Description copied from interface:Directory- Specified by:
getWritablesin interfaceDirectory<WritableOnDisk>
-
prepare
public void prepare(ImmutableStack<Object> indices)
Description copied from class:FileOnDiskDoes nothing.- Specified by:
preparein interfaceWritable<WritableOnDisk>- Overrides:
preparein classFileOnDisk
-
getBytes
public byte[] getBytes()
Description copied from interface:FileReturns the bytes contained by thisFile.- Specified by:
getBytesin interfaceFile<WritableOnDisk>- Overrides:
getBytesin classFileOnDisk
-
setBytes
public void setBytes(byte[] bytes)
Description copied from interface:FileSets the bytes to be contained by thisFile.- Specified by:
setBytesin interfaceFile<WritableOnDisk>- Overrides:
setBytesin classFileOnDisk
-
getBytesForChecksum
protected byte[] getBytesForChecksum()
Description copied from class:FileOnDiskWithChecksumFetches the target bytes for computation of the checksum. Will take the bytes of itsFileOnDisk.- Overrides:
getBytesForChecksumin classFileOnDiskWithChecksum- Returns:
- the checksum bytes
-
-