|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.archive.checksum.ChecksumArchive
public abstract class ChecksumArchive
This abstract class is the interface for the checksum archives, which can be
one of the following:
- FileChecksumArchive where the archive is placed in a single file.
TODO
- DatabaseChecksumArchive where the archive is placed in a
database.
FileChecksumArchive
Constructor Summary | |
---|---|
protected |
ChecksumArchive()
Constructor. |
Method Summary | |
---|---|
protected abstract java.lang.String |
calculateChecksum(java.io.File f)
Method for calculating the checksum of a specific file. |
protected abstract java.lang.String |
calculateChecksum(java.io.InputStream is)
Method for calculating the checksum when the file is received in the form of an inputstream. |
abstract void |
cleanup()
Method for cleaning up when closing down. |
abstract java.io.File |
correct(java.lang.String filename,
java.io.File correctFile)
Method for removing a bad entry from the archive. |
abstract java.io.File |
getAllFilenames()
Method for retrieving the names of all the files within the archive as a temporary file. |
abstract java.io.File |
getArchiveAsFile()
Method for retrieving the archive as a temporary file containing the checksum entries. |
abstract java.lang.String |
getChecksum(java.lang.String filename)
Method for retrieving the checksum of a specific entry in the archive. |
abstract boolean |
hasEnoughSpace()
Method for checking whether there is enough space left on the hard drive. |
abstract boolean |
hasEntry(java.lang.String filename)
Method for checking whether an entry exists within the archive. |
abstract void |
upload(RemoteFile arcfile,
java.lang.String filename)
Method for uploading a new file to the archive. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ChecksumArchive()
Method Detail |
---|
public abstract boolean hasEnoughSpace()
public abstract java.io.File correct(java.lang.String filename, java.io.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.public abstract java.lang.String getChecksum(java.lang.String filename)
filename
- The name of the file entry in the archive for whom the
checksum should be retrieved.
public abstract boolean hasEntry(java.lang.String filename)
filename
- The name of the file whose entry in the archive should
be determined.
public abstract void upload(RemoteFile arcfile, java.lang.String filename)
arcfile
- The remote file to be uploaded.filename
- The name of the file.protected abstract java.lang.String calculateChecksum(java.io.File f)
f
- The file to calculate the checksum from.
protected abstract java.lang.String calculateChecksum(java.io.InputStream is)
is
- The input stream to calculate the checksum from.
public abstract java.io.File getArchiveAsFile()
public abstract java.io.File getAllFilenames()
public abstract void cleanup()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |