public class Bitarchive extends Object
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log
Logging output place.
|
Modifier and Type | Method and Description |
---|---|
BatchStatus |
batch(String bitarchiveAppId,
FileBatchJob job)
Run a batch job on all ARC entries in the archive.
|
void |
close()
Release all resources allocated by the bitarchive Ensures that all admin data and log data are flushed.
|
BitarchiveRecord |
get(String arcfile,
long index)
Get an ARC or WARC record out of the archive.
|
File |
getFile(String arcFileID)
Get a file for a given arcFileID.
|
static Bitarchive |
getInstance()
Get the one instance of the bitarchive.
|
void |
upload(RemoteFile arcfile,
String fileName)
Upload an ARC file to this archive.
|
protected static final org.slf4j.Logger log
public void close()
public BitarchiveRecord get(String arcfile, long index) throws ArgumentNotValid, UnknownID, IOFailure
arcfile
- The name of an Archive file.index
- Index of the Archive record in the fileArgumentNotValid
- If arcfile is null/empty, or if index is out of boundsIOFailure
- If there were problems reading the arcfile.UnknownID
- Does it really, and when ?public void upload(RemoteFile arcfile, String fileName) throws PermissionDenied, ArgumentNotValid, IOFailure
arcfile
- A file to add to the archive.fileName
- the arcfiles filename. The file will be identified in the archive by this filenamePermissionDenied
- if arcfile already exists in the archiveIOFailure
- if an IO failure occurs (e.g. running out of disk space)ArgumentNotValid
- if arcfile is null or the filename is null or empty.public BatchStatus batch(String bitarchiveAppId, FileBatchJob job) throws ArgumentNotValid, IOFailure
This currently runs synchronously, and returns only after finish() has been called.
bitarchiveAppId
- A String representing the bitarchive AppId.job
- An object that implements the ARCBatchJob interface. The initialize() method will be called before
processing and the finish() method will be called afterwards. The process() method will be called with each ARC
entry.ArgumentNotValid
- if job or file is null.IOFailure
- if there was problems writing to the RemoteFilepublic File getFile(String arcFileID) throws ArgumentNotValid
arcFileID
- name of the file to be retrieved.ArgumentNotValid
- If arcFileID was null or empty.public static Bitarchive getInstance() throws PermissionDenied
PermissionDenied
- If the storage area used for files is not accessible.Copyright © 2005–2015 The Royal Danish Library, the Danish State and University Library, the National Library of France and the Austrian National Library.. All rights reserved.