|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.archive.bitarchive.BitarchiveAdmin
public class BitarchiveAdmin
This class handles file lookup and encapsulates the actual placement of files.
Method Summary | |
---|---|
void |
close()
Close down the bitarchive admin. |
java.io.File |
getAtticPath(java.io.File existingFile)
Return the path used to store files that are removed by RemoveAndGetFileMessage. |
java.io.File[] |
getFiles()
Return array with references to all files in the archive. |
java.io.File[] |
getFilesMatching(java.util.regex.Pattern regexp)
Return an array of all files in this archive that match a given regular expression on the filename. |
static BitarchiveAdmin |
getInstance()
Get the one and only instance of the bitarchive admin. |
java.io.File |
getTemporaryPath(java.lang.String arcFileName,
long requestedSize)
Returns a temporary place for the the file to be stored. |
boolean |
hasEnoughSpace()
Returns true if we have at least one dir with the required amount of space left. |
protected boolean |
isBitarchiveDirectory(java.io.File theDir)
Checks whether a directory is one of the known bitarchive directories. |
BitarchiveARCFile |
lookup(java.lang.String arcFileName)
Return the path that a given arc file can be found in. |
java.io.File |
moveToStorage(java.io.File tempLocation)
Moves a file from temporary storage to file storage. |
void |
updateFileList(java.io.File basedir)
Method for updating the filelist for a given basedir. |
void |
verifyFilelistUpToDate()
Checks whether the filelist is up to date. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void verifyFilelistUpToDate()
public void updateFileList(java.io.File basedir) throws ArgumentNotValid, UnknownID, IOFailure
basedir
- The basedir to update the filelist for.
ArgumentNotValid
- If basedir is null or if it not a proper
directory.
UnknownID
- If the basedir cannot be found both the archivedFiles
map or the archiveTime map.
IOFailure
- If it is not possible to retrieve the canonical file
for the basedir.public boolean hasEnoughSpace()
public java.io.File getTemporaryPath(java.lang.String arcFileName, long requestedSize) throws ArgumentNotValid, IOFailure
arcFileName
- The simple name (i.e. no dirs) of the ARC file.requestedSize
- How large the file is in bytes.
ArgumentNotValid
- If arcFileName is null or empty, or requestedSize is negative.
IOFailure
- if there is no more room left to store this file of
size=requestedSizepublic java.io.File moveToStorage(java.io.File tempLocation) throws IOFailure, ArgumentNotValid
tempLocation
- The temporary location where the file was stored.
This must be a path returned from getTemporaryPath
IOFailure
- if tempLocation is not created from getTemporaryPath
or file cannot be moved to Storage location.
ArgumentNotValid
- If the tempLocation file is null.protected boolean isBitarchiveDirectory(java.io.File theDir) throws ArgumentNotValid, IOFailure
theDir
- The dir to check
IOFailure
- if theDir or one of the valid archive directories
does not exist
ArgumentNotValid
- if theDir is nullpublic java.io.File[] getFiles()
public java.io.File[] getFilesMatching(java.util.regex.Pattern regexp)
regexp
- A precompiled regular expression matching whole filenames.
This will probably be given to a FilenameFilter
public BitarchiveARCFile lookup(java.lang.String arcFileName)
arcFileName
- Name of an arc file (with no path)
public static BitarchiveAdmin getInstance()
public void close()
public java.io.File getAtticPath(java.io.File existingFile)
existingFile
- a File object for an existing file in the bitarchive
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |