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>
AnArchive
that 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 anArchive
with an internal, temporary directory to store writables in.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addWritable(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()
void
prepare(ImmutableStack<Object> indices)
Does nothing.void
setBytes(byte[] bytes)
Sets the bytes to be contained by thisFile
.void
setParent(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:Writable
Sets the parent of thisWritable
.- Specified by:
setParent
in interfaceWritable<WritableOnDisk>
- Overrides:
setParent
in classWritableOnDisk
-
addWritable
public void addWritable(Writable<WritableOnDisk> writable)
Description copied from interface:Directory
- Specified by:
addWritable
in interfaceDirectory<WritableOnDisk>
-
getWritables
public Set<Writable<WritableOnDisk>> getWritables()
Description copied from interface:Directory
- Specified by:
getWritables
in interfaceDirectory<WritableOnDisk>
-
prepare
public void prepare(ImmutableStack<Object> indices)
Description copied from class:FileOnDisk
Does nothing.- Specified by:
prepare
in interfaceWritable<WritableOnDisk>
- Overrides:
prepare
in classFileOnDisk
-
getBytes
public byte[] getBytes()
Description copied from interface:File
Returns the bytes contained by thisFile
.- Specified by:
getBytes
in interfaceFile<WritableOnDisk>
- Overrides:
getBytes
in classFileOnDisk
-
setBytes
public void setBytes(byte[] bytes)
Description copied from interface:File
Sets the bytes to be contained by thisFile
.- Specified by:
setBytes
in interfaceFile<WritableOnDisk>
- Overrides:
setBytes
in classFileOnDisk
-
getBytesForChecksum
protected byte[] getBytesForChecksum()
Description copied from class:FileOnDiskWithChecksum
Fetches the target bytes for computation of the checksum. Will take the bytes of itsFileOnDisk
.- Overrides:
getBytesForChecksum
in classFileOnDiskWithChecksum
- Returns:
- the checksum bytes
-
-