public class S3BitStoreService extends Object implements BitStoreService
| Constructor and Description |
|---|
S3BitStoreService() |
| Modifier and Type | Method and Description |
|---|---|
Map |
about(Bitstream bitstream,
Map attrs)
Obtain technical metadata about an asset in the asset store.
|
String |
generateId()
Return an identifier unique to this asset store instance
|
InputStream |
get(Bitstream bitstream)
Retrieve the bits for the asset with ID.
|
String |
getAwsAccessKey() |
String |
getAwsRegionName() |
String |
getAwsSecretKey() |
String |
getBucketName() |
String |
getFullKey(String id)
Utility Method: Prefix the key with a subfolder, if this instance assets are stored within subfolder
|
String |
getSubfolder() |
void |
init()
Initialize the asset store
S3 Requires:
- access key
- secret key
- bucket name
|
static void |
main(String[] args)
Contains a command-line testing tool.
|
void |
put(Bitstream bitstream,
InputStream in)
Store a stream of bits.
|
void |
remove(Bitstream bitstream)
Remove an asset from the asset store.
|
void |
setAwsAccessKey(String awsAccessKey) |
void |
setAwsRegionName(String awsRegionName) |
void |
setAwsSecretKey(String awsSecretKey) |
void |
setBucketName(String bucketName) |
void |
setSubfolder(String subfolder) |
public void init()
throws IOException
init in interface BitStoreServiceIOExceptionpublic String generateId()
generateId in interface BitStoreServicepublic InputStream get(Bitstream bitstream) throws IOException
get in interface BitStoreServicebitstream - The ID of the asset to retrieveIOException - If a problem occurs while retrieving the bitspublic void put(Bitstream bitstream, InputStream in) throws IOException
If this method returns successfully, the bits have been stored. If an exception is thrown, the bits have not been stored.
put in interface BitStoreServicein - The stream of bits to storebitstream - The bitsream objectIOException - If a problem occurs while storing the bitspublic Map about(Bitstream bitstream, Map attrs) throws IOException
about in interface BitStoreServicebitstream - The asset to describeattrs - A Map whose keys consist of desired metadata fieldsIOException - If a problem occurs while obtaining metadatapublic void remove(Bitstream bitstream) throws IOException
remove in interface BitStoreServicebitstream - The asset to deleteIOException - If a problem occurs while removing the assetpublic String getFullKey(String id)
id - public String getAwsAccessKey()
public void setAwsAccessKey(String awsAccessKey)
public String getAwsSecretKey()
public void setAwsSecretKey(String awsSecretKey)
public String getAwsRegionName()
public void setAwsRegionName(String awsRegionName)
public String getBucketName()
public void setBucketName(String bucketName)
public String getSubfolder()
public void setSubfolder(String subfolder)
Copyright © 2016 DuraSpace. All Rights Reserved.