public interface ChecksumArchive
FileChecksumArchive
Modifier and Type | Method and Description |
---|---|
String |
calculateChecksum(File f)
Method for calculating the checksum of a specific file.
|
String |
calculateChecksum(InputStream is)
Method for calculating the checksum when the file is received in the form of an inputstream.
|
void |
cleanup()
Method for cleaning up when closing down.
|
File |
correct(String filename,
File correctFile)
Method for removing a bad entry from the archive.
|
File |
getAllFilenames()
Method for retrieving the names of all the files within the archive as a temporary file.
|
File |
getArchiveAsFile()
Method for retrieving the archive as a temporary file containing the checksum entries.
|
String |
getChecksum(String filename)
Method for retrieving the checksum of a specific entry in the archive.
|
boolean |
hasEnoughSpace()
Method for checking whether there is enough space left on the hard drive.
|
boolean |
hasEntry(String filename)
Method for checking whether an entry exists within the archive.
|
void |
upload(RemoteFile arcfile,
String filename)
Method for uploading a new file to the archive.
|
void |
upload(String checksum,
String filename)
Upload a filename with a pre-computed checksum.
|
boolean hasEnoughSpace()
File correct(String filename, File correctFile) throws IOFailure, ArgumentNotValid, IllegalState
filename
- The name of the file whose record should be removed.correctFile
- The correct remote file to replace the bad one in the archive.ArgumentNotValid
- If one of the arguments are not valid.IOFailure
- If the entry cannot be corrected.IllegalState
- If no such entry exists to be corrected, or if the entry has a different checksum than
expected.String getChecksum(String filename)
filename
- The name of the file entry in the archive for whom the checksum should be retrieved.boolean hasEntry(String filename)
filename
- The name of the file whose entry in the archive should be determined.void upload(RemoteFile arcfile, String filename)
arcfile
- The remote file to be uploaded.filename
- The name of the file.void upload(String checksum, String filename)
checksum
- filename
- String calculateChecksum(File f)
f
- The file to calculate the checksum from.String calculateChecksum(InputStream is)
is
- The input stream to calculate the checksum from.File getArchiveAsFile()
File getAllFilenames()
void cleanup()
Copyright © 2005–2016 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.