Package org.dspace.storage.bitstore
Class DSBitStoreService
java.lang.Object
org.dspace.storage.bitstore.BaseBitStoreService
org.dspace.storage.bitstore.DSBitStoreService
- All Implemented Interfaces:
BitStoreService
Native DSpace (or "Directory Scatter" if you prefer) asset store.
Implements a directory 'scatter' algorithm to avoid OS limits on
files per directory.
- Author:
- Peter Breton, Robert Tansley, Richard Rodgers, Peter Dietz
-
Field Summary
FieldsFields inherited from class org.dspace.storage.bitstore.BaseBitStoreService
CHECKSUM, CHECKSUM_ALGORITHM, CSA, digitsPerLevel, directoryLevels, initialized, MODIFIED, SIZE_BYTES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObtain technical metadata about an asset in the asset store.Return an identifier unique to this asset store instanceRetrieve the bits for the asset with ID.protected FileReturn the file corresponding to a bitstream.voidinit()Initialize the asset storebooleanisRegisteredBitstream(String internalId) voidput(Bitstream bitstream, InputStream in) Store a stream of bits.voidRemove an asset from the asset store.voidsetBaseDir(File baseDir) Methods inherited from class org.dspace.storage.bitstore.BaseBitStoreService
about, appendSeparator, endsWithSeparator, extractSubstringFrom, getIntermediatePath, isInitialized, isLonger, populatePathSplittingId, putValueIfExistsKey, sanitizeIdentifierMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.dspace.storage.bitstore.BitStoreService
isEnabled
-
Field Details
-
REGISTERED_FLAG
- See Also:
-
-
Constructor Details
-
DSBitStoreService
public DSBitStoreService()
-
-
Method Details
-
init
public void init()Initialize the asset store -
generateId
Return an identifier unique to this asset store instance- Returns:
- a unique ID
-
get
Retrieve the bits for the asset with ID. If the asset does not exist, returns null.- Parameters:
bitstream- The ID of the asset to retrieve- Returns:
- The stream of bits, or null
- Throws:
IOException- If a problem occurs while retrieving the bits
-
put
Store a stream of bits.If this method returns successfully, the bits have been stored. If an exception is thrown, the bits have not been stored.
- Parameters:
in- The stream of bits to storebitstream- The bitstream object- Throws:
IOException- If a problem occurs while storing the bits
-
about
Obtain technical metadata about an asset in the asset store.- Parameters:
bitstream- The asset to describeattrs- A List of desired metadata fields- Returns:
- attrs A Map with key/value pairs of desired metadata
- Throws:
IOException- If a problem occurs while obtaining metadata
-
remove
Remove an asset from the asset store. An irreversible operation.- Parameters:
bitstream- The asset to delete- Throws:
IOException- If a problem occurs while removing the asset
-
getFile
Return the file corresponding to a bitstream. It's safe to pass innull.- Parameters:
bitstream- the database table row for the bitstream. Can benull- Returns:
- The corresponding file in the file system, or
null - Throws:
IOException- If a problem occurs while determining the file
-
isRegisteredBitstream
-
getBaseDir
-
setBaseDir
-