public class S3ClientServiceImpl extends AbstractService implements S3ClientService
Constructor and Description |
---|
S3ClientServiceImpl()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
bucketExists(String bucket)
Check whether a bucket exists
|
InputStream |
getObject(String bucket,
String object,
long offset)
Read an object
|
void |
getObject(String bucket,
String object,
String filename)
Download an object
|
void |
initialize(String server,
int port,
String accessKey,
String secretKey,
String appName,
String appVersion)
Initialise the S3 client
|
S3ClientStat |
statObject(String bucket,
String object)
Stat the object
|
checkClassDependency
public void initialize(String server, int port, String accessKey, String secretKey, String appName, String appVersion) throws S3ClientServiceException
S3ClientService
initialize
in interface S3ClientService
server
- servernameport
- portaccessKey
- access keysecretKey
- secret keyappName
- user agent application nameappVersion
- user agent application versionS3ClientServiceException
- if an S3 error occurredpublic boolean bucketExists(String bucket) throws S3ClientServiceException, IOException
S3ClientService
bucketExists
in interface S3ClientService
bucket
- Bucket nameS3ClientServiceException
- if an S3 error occurredIOException
- if an S3 error occurredpublic S3ClientStat statObject(String bucket, String object) throws S3ClientServiceException, IOException
S3ClientService
statObject
in interface S3ClientService
bucket
- Bucket nameobject
- Object pathS3ClientServiceException
- if an S3 error occurredIOException
- if an S3 error occurredpublic InputStream getObject(String bucket, String object, long offset) throws S3ClientServiceException, IOException
S3ClientService
getObject
in interface S3ClientService
bucket
- Bucket nameobject
- Object pathoffset
- Start reading at this offsetS3ClientServiceException
- if an S3 error occurredIOException
- if an S3 error occurredpublic void getObject(String bucket, String object, String filename) throws S3ClientServiceException, IOException
S3ClientService
getObject
in interface S3ClientService
bucket
- Bucket nameobject
- Object pathfilename
- Destination fileS3ClientServiceException
- if an S3 error occurredIOException
- if an S3 error occurredCopyright © 2005–2019 Open Microscopy Environment. All rights reserved.