@Deprecated public class TOSClient extends Object implements TOS
| Constructor and Description |
|---|
TOSClient(Session session)
Deprecated.
|
TOSClient(String endpoint,
ClientOptionsBuilder... options)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
AbortMultipartUploadOutput |
abortMultipartUpload(String bucket,
AbortMultipartUploadInput input)
Deprecated.
abort a multipart upload operation
|
AppendObjectOutput |
appendObject(String bucket,
String objectKey,
InputStream content,
long offset,
RequestOptionsBuilder... builders)
Deprecated.
append content at the tail of an appendable object
|
CompleteMultipartUploadOutput |
completeMultipartUpload(String bucket,
CompleteMultipartUploadInput input)
Deprecated.
complete a multipart upload operation
|
CopyObjectOutput |
copyObject(String bucket,
String srcObjectKey,
String dstObjectKey,
RequestOptionsBuilder... builders)
Deprecated.
copy an object in the same bucket
|
CopyObjectOutput |
copyObjectFrom(String bucket,
String srcBucket,
String srcObjectKey,
String dstObjectKey,
RequestOptionsBuilder... builders)
Deprecated.
copy an object from bucket A to bucket B, the method is called by bucket B.
|
CopyObjectOutput |
copyObjectTo(String bucket,
String dstBucket,
String dstObjectKey,
String srcObjectKey,
RequestOptionsBuilder... builders)
Deprecated.
copy an object from bucket A to bucket B, the method is called by bucket A.
|
CreateBucketOutput |
createBucket(CreateBucketInput input)
Deprecated.
create a new bucket
|
CreateMultipartUploadOutput |
createMultipartUpload(String bucket,
String objectKey,
RequestOptionsBuilder... builders)
Deprecated.
create a multipart upload operation
|
DeleteBucketOutput |
deleteBucket(String bucket)
Deprecated.
delete an existed bucket
|
DeleteBucketPolicyOutput |
deleteBucketPolicy(String bucket)
Deprecated.
删除桶策略
|
DeleteMultiObjectsOutput |
deleteMultiObjects(String bucket,
DeleteMultiObjectsInput input,
RequestOptionsBuilder... builders)
Deprecated.
delete a list of objects
|
DeleteObjectOutput |
deleteObject(String bucket,
String objectKey,
RequestOptionsBuilder... builders)
Deprecated.
delete an object
|
GetBucketPolicyOutput |
getBucketPolicy(String bucket)
Deprecated.
获取桶策略
|
Config |
getConfig()
Deprecated.
|
Credentials |
getCredentials()
Deprecated.
|
String |
getHost()
Deprecated.
|
GetObjectOutput |
getObject(String bucket,
String objectKey,
RequestOptionsBuilder... builders)
Deprecated.
get data and metadata of an object
|
GetObjectAclOutput |
getObjectAcl(String bucket,
String objectKey,
RequestOptionsBuilder... builders)
Deprecated.
get object's acl grants or rules
|
String |
getScheme()
Deprecated.
|
Signer |
getSigner()
Deprecated.
|
Transport |
getTransport()
Deprecated.
|
int |
getUrlMode()
Deprecated.
|
String |
getUserAgent()
Deprecated.
|
HeadBucketOutput |
headBucket(String bucket)
Deprecated.
get bucket's meta data
|
HeadObjectOutput |
headObject(String bucket,
String objectKey,
RequestOptionsBuilder... builders)
Deprecated.
get metadata of an object with its data stream
|
ListBucketsOutput |
listBuckets(ListBucketsInput input)
Deprecated.
list existed bucket owned by you.
|
ListMultipartUploadsOutput |
listMultipartUploads(String bucket,
ListMultipartUploadsInput input)
Deprecated.
list multipart uploads
|
ListObjectsOutput |
listObjects(String bucket,
ListObjectsInput input)
Deprecated.
list objects of a bucket
|
ListObjectVersionsOutput |
listObjectVersions(String bucket,
ListObjectVersionsInput input)
Deprecated.
list multi-version objects of a bucket
|
ListUploadedPartsOutput |
listUploadedParts(String bucket,
ListUploadedPartsInput input,
RequestOptionsBuilder... builders)
Deprecated.
list parts that have been uploaded.
|
protected RequestBuilder |
newBuilder(String bucket,
String object,
RequestOptionsBuilder... builders)
Deprecated.
|
String |
preSignedURL(String httpMethod,
String bucket,
String objectKey,
Duration ttl,
RequestOptionsBuilder... builders)
Deprecated.
create a pre-signed URL
|
PutBucketPolicyOutput |
putBucketPolicy(String bucket,
String policy)
Deprecated.
设置桶策略
|
PutObjectOutput |
putObject(String bucket,
String objectKey,
InputStream inputStream,
RequestOptionsBuilder... builders)
Deprecated.
upload an object to TOS server
|
PutObjectAclOutput |
putObjectAcl(String bucket,
PutObjectAclInput input)
Deprecated.
set object's acl grants or rules
|
TOSClient |
setConfig(Config config)
Deprecated.
|
TOSClient |
setCredentials(Credentials credentials)
Deprecated.
|
TOSClient |
setHost(String host)
Deprecated.
|
SetObjectMetaOutput |
setObjectMeta(String bucket,
String objectKey,
RequestOptionsBuilder... builders)
Deprecated.
set some metadata of the object
|
TOSClient |
setScheme(String scheme)
Deprecated.
|
TOSClient |
setSigner(Signer signer)
Deprecated.
|
TOSClient |
setTransport(Transport transport)
Deprecated.
|
TOSClient |
setUrlMode(int urlMode)
Deprecated.
|
TOSClient |
setUserAgent(String userAgent)
Deprecated.
|
String |
toString()
Deprecated.
|
UploadFileOutput |
uploadFile(String bucket,
UploadFileInput input,
RequestOptionsBuilder... builders)
Deprecated.
|
UploadPartOutput |
uploadPart(String bucket,
UploadPartInput input,
RequestOptionsBuilder... builders)
Deprecated.
upload a part for a multipart upload operation
|
UploadPartCopyOutput |
uploadPartCopy(String bucket,
UploadPartCopyInput input,
RequestOptionsBuilder... builders)
Deprecated.
copy a part of object as a part of a multipart upload operation
|
public TOSClient(Session session)
public TOSClient(String endpoint, ClientOptionsBuilder... options)
protected RequestBuilder newBuilder(String bucket, String object, RequestOptionsBuilder... builders)
public CreateBucketOutput createBucket(CreateBucketInput input) throws TosException
TOScreateBucket in interface TOSinput - require input's bucketName not nullCreateBucketOutputTosExceptionpublic HeadBucketOutput headBucket(String bucket) throws TosException
TOSheadBucket in interface TOSbucket - bucket nameHeadBucketOutputTosExceptionpublic DeleteBucketOutput deleteBucket(String bucket) throws TosException
TOSdeleteBucket in interface TOSbucket - bucket nameDeleteBucketOutputTosExceptionpublic ListBucketsOutput listBuckets(ListBucketsInput input) throws TosException
TOSlistBuckets in interface TOSinput - no params requiredListBucketsOutputTosExceptionpublic PutBucketPolicyOutput putBucketPolicy(String bucket, String policy) throws TosException
TOSputBucketPolicy in interface TOSbucket - 桶名policy - 桶策略TosExceptionpublic GetBucketPolicyOutput getBucketPolicy(String bucket) throws TosException
TOSgetBucketPolicy in interface TOSbucket - 桶名TosExceptionpublic DeleteBucketPolicyOutput deleteBucketPolicy(String bucket) throws TosException
TOSdeleteBucketPolicy in interface TOSbucket - 桶名TosExceptionpublic GetObjectOutput getObject(String bucket, String objectKey, RequestOptionsBuilder... builders) throws TosException
TOSgetObject in interface TOSbucket - the bucket to operateobjectKey - the name of objectbuilders - optional. setting withXXX properties.
withVersionID: which version of this object.
withRange: the range of content.
withIfModifiedSince: return if the object modified after the given date,
otherwise return status code 304.
withIfUnmodifiedSince, withIfMatch, withIfNoneMatch set If-Unmodified-Since, If-Match and If-None-Match.GetObjectOutputTosExceptionpublic HeadObjectOutput headObject(String bucket, String objectKey, RequestOptionsBuilder... builders) throws TosException
TOSheadObject in interface TOSbucket - the bucket to operateobjectKey - the name of objectbuilders - optional. setting withXXX properties.
withVersionID: which version of this object.
withRange: the range of content.
withIfModifiedSince: return if the object modified after the given date,
otherwise return status code 304.
withIfUnmodifiedSince, withIfMatch, withIfNoneMatch set If-Unmodified-Since, If-Match and If-None-Match.HeadObjectOutputTosExceptionpublic DeleteObjectOutput deleteObject(String bucket, String objectKey, RequestOptionsBuilder... builders) throws TosException
TOSdeleteObject in interface TOSbucket - the bucket to operateobjectKey - the name of objectbuilders - optional. setting withXXX properties.
withVersionID: which version of this object will be deletedDeleteObjectOutputTosExceptionpublic DeleteMultiObjectsOutput deleteMultiObjects(String bucket, DeleteMultiObjectsInput input, RequestOptionsBuilder... builders) throws TosException
TOSdeleteMultiObjects in interface TOSbucket - the bucket to operateinput - the objects to be deletedbuilders - optional. setting withXXX properties.DeleteMultiObjectsOutputTosExceptionpublic PutObjectOutput putObject(String bucket, String objectKey, InputStream inputStream, RequestOptionsBuilder... builders) throws TosException
TOSputObject in interface TOSbucket - the bucket to operateobjectKey - the name of objectinputStream - the content of objectbuilders - optional. setting withXXX properties.
withContentType: set Content-Type.
withContentDisposition: set Content-Disposition.
withContentLanguage: set Content-Language.
withContentEncoding: set Content-Encoding.
withCacheControl: set Cache-Control.
withExpires: set Expires.
withMeta: set meta header(s).
withContentSHA256: set Content-Sha256.
withContentMD5: set Content-MD5.
withExpires: set Expires.
withServerSideEncryptionCustomer: set server side encryption options.
withACL, withACLGrantFullControl, withACLGrantRead, withACLGrantReadAcp,
withACLGrantWrite, withACLGrantWriteAcp set object acl.
withStorageClass set storage class, 'STANDARD|IA'PutObjectOutputTosExceptionpublic UploadFileOutput uploadFile(String bucket, UploadFileInput input, RequestOptionsBuilder... builders) throws TosException
uploadFile in interface TOSTosExceptionpublic AppendObjectOutput appendObject(String bucket, String objectKey, InputStream content, long offset, RequestOptionsBuilder... builders) throws TosException
TOSappendObject in interface TOSbucket - the bucket to operateobjectKey - the name of objectcontent - the content of objectoffset - append position, equals to the current object-sizebuilders - optional. setting withXXX properties.
withContentType: set Content-Type.
withContentDisposition: set Content-Disposition.
withContentLanguage: set Content-Language.
withContentEncoding: set Content-Encoding.
withCacheControl: set Cache-Control.
withExpires: set Expires.
withMeta: set meta header(s).
withExpires: set Expires.
withACL, withACLGrantFullControl, withACLGrantRead, withACLGrantReadAcp,
withACLGrantWrite, withACLGrantWriteAcp set object acl.
withStorageClass set storage class, 'STANDARD|IA'
above options only take effect when offset parameter is 0.
withContentSHA256: set Content-Sha256.
withContentMD5: set Content-MD5.AppendObjectOutputTosExceptionpublic SetObjectMetaOutput setObjectMeta(String bucket, String objectKey, RequestOptionsBuilder... builders) throws TosException
TOSsetObjectMeta in interface TOSbucket - the bucket to operateobjectKey - the name of objectbuilders - optional. setting withXXX properties.
withContentType set Content-Type.
withContentDisposition set Content-Disposition.
withContentLanguage set Content-Languag.
withContentEncoding set Content-Encoding.
withCacheControl set Cache-Control.
withExpires set Expires.
withMeta set meta header(s).
withVersionID which version of this object will be setSetObjectMetaOutputTosExceptionpublic ListObjectsOutput listObjects(String bucket, ListObjectsInput input) throws TosException
TOSlistObjects in interface TOSbucket - the bucket to operateinput - query paramsListObjectsOutputTosExceptionpublic ListObjectVersionsOutput listObjectVersions(String bucket, ListObjectVersionsInput input) throws TosException
TOSlistObjectVersions in interface TOSbucket - the bucket to operateinput - query paramsListObjectVersionsOutputTosExceptionpublic CopyObjectOutput copyObject(String bucket, String srcObjectKey, String dstObjectKey, RequestOptionsBuilder... builders) throws TosException
TOScopyObject in interface TOSbucket - the bucket to operatesrcObjectKey - the source object namedstObjectKey - the destination object name
NOTICE: srcObjectKey and dstObjectKey belongs to the same bucket.builders - optional. setting withXXX properties.
withVersionID the version id of source object.
withMetadataDirective copy source object metadata or replace with new object metadata.
withACL withACLGrantFullControl withACLGrantRead withACLGrantReadAcp
withACLGrantWrite withACLGrantWriteAcp set object acl.
withCopySourceIfMatch withCopySourceIfNoneMatch withCopySourceIfModifiedSince
withCopySourceIfUnmodifiedSince set copy conditions.
withStorageClass set storage class, 'STANDARD|IA'
withServerSideEncryptionCustomer: Copy SSE-C加密对象,源对象的加密算法、加密密钥、密钥MD5
if copyObject called with withMetadataDirective(TosHeaders.METADATA_DIRECTIVE_REPLACE),
these properties can be used:
withContentType set Content-Type.
withContentDisposition set Content-Disposition.
withContentLanguage set Content-Language.
withContentEncoding set Content-Encoding.
withCacheControl set Cache-Control.
withExpires set Expires.
withMeta set meta header(s),CopyObjectOutputTosExceptionpublic CopyObjectOutput copyObjectTo(String bucket, String dstBucket, String dstObjectKey, String srcObjectKey, RequestOptionsBuilder... builders) throws TosException
TOScopyObjectTo in interface TOSbucket - the bucket to operatedstBucket - the destination bucketdstObjectKey - the destination object namesrcObjectKey - the source object namebuilders - optional. setting withXXX properties.
withVersionID the version id of source object.
withMetadataDirective copy source object metadata or replace with new object metadata.
withACL withACLGrantFullControl withACLGrantRead withACLGrantReadAcp
withACLGrantWrite withACLGrantWriteAcp set object acl.
withCopySourceIfMatch withCopySourceIfNoneMatch withCopySourceIfModifiedSince
withCopySourceIfUnmodifiedSince set copy conditions.
withStorageClass set storage class, 'STANDARD|IA'
withServerSideEncryptionCustomer: Copy SSE-C加密对象,源对象的加密算法、加密密钥、密钥MD5
if copyObjectTo called with withMetadataDirective(TosHeaders.METADATA_DIRECTIVE_REPLACE),
these properties can be used:
withContentType set Content-Type.
withContentDisposition set Content-Disposition.
withContentLanguage set Content-Language.
withContentEncoding set Content-Encoding.
withCacheControl set Cache-Control.
withExpires set Expires.
withMeta set meta header(s).CopyObjectOutputTosExceptionpublic CopyObjectOutput copyObjectFrom(String bucket, String srcBucket, String srcObjectKey, String dstObjectKey, RequestOptionsBuilder... builders) throws TosException
TOScopyObjectFrom in interface TOSbucket - the bucket to operatesrcBucket - the source bucketsrcObjectKey - the source object namedstObjectKey - the destination object namebuilders - optional. setting withXXX properties.
withVersionID the version id of source object.
withMetadataDirective copy source object metadata or replace with new object metadata.
withACL withACLGrantFullControl withACLGrantRead withACLGrantReadAcp
withACLGrantWrite withACLGrantWriteAcp set object acl.
withCopySourceIfMatch withCopySourceIfNoneMatch withCopySourceIfModifiedSince
withCopySourceIfUnmodifiedSince set copy conditions.
withStorageClass set storage class, 'STANDARD|IA'
withServerSideEncryptionCustomer: Copy SSE-C加密对象,源对象的加密算法、加密密钥、密钥MD5
if copyObjectFrom called with withMetadataDirective(TosHeaders.METADATA_DIRECTIVE_REPLACE),
these properties can be used:
withContentType set Content-Type.
withContentDisposition set Content-Disposition.
withContentLanguage set Content-Language.
withContentEncoding set Content-Encoding.
withCacheControl set Cache-Control.
withExpires set Expires.
withMeta set meta header(s).CopyObjectOutputTosExceptionpublic UploadPartCopyOutput uploadPartCopy(String bucket, UploadPartCopyInput input, RequestOptionsBuilder... builders) throws TosException
TOSuploadPartCopy in interface TOSbucket - the bucket to operateinput - uploadID, destinationKey, sourceBucket, sourceKey, partNumber, partSize and startOffset are inclusive,
other parameters are optional.builders - optional. setting withXXX properties.
withCopySourceIfMatch, withCopySourceIfNoneMatch, withCopySourceIfModifiedSince and
withCopySourceIfUnmodifiedSince set copy conditions
withServerSideEncryption: set server side encryption algorithm, 'AES256'.
withServerSideEncryptionCustomer: Copy SSE-C加密对象,源对象的加密算法、加密密钥、密钥MD5UploadPartCopyOutputTosExceptionpublic PutObjectAclOutput putObjectAcl(String bucket, PutObjectAclInput input) throws TosException
TOSputObjectAcl in interface TOSbucket - the bucket to operateinput - aclGrant, aclRules can not set both.PutObjectAclOutputTosExceptionpublic GetObjectAclOutput getObjectAcl(String bucket, String objectKey, RequestOptionsBuilder... builders) throws TosException
TOSgetObjectAcl in interface TOSbucket - the bucket to operateobjectKey - the name of objectbuilders - optional. setting withXXX properties.
withVersionID the version of the objectGetObjectAclOutputTosExceptionpublic CreateMultipartUploadOutput createMultipartUpload(String bucket, String objectKey, RequestOptionsBuilder... builders) throws TosException
TOScreateMultipartUpload in interface TOSbucket - the bucket to operateobjectKey - the name of objectbuilders - optional. setting withXXX properties.
withContentType set Content-Type.
withContentDisposition set Content-Disposition.
withContentLanguage set Content-Language.
withContentEncoding set Content-Encoding.
withCacheControl set Cache-Control.
withExpires set Expires.
withMeta set meta header(s).
withContentSHA256 set Content-Sha256.
withContentMD5 set Content-MD5.
withExpires set Expires.
withServerSideEncryptionCustomer set server side encryption options.
withACL, WithACLGrantFullControl, withACLGrantRead, withACLGrantReadAcp,
withACLGrantWrite, withACLGrantWriteAcp set object acl.
withStorageClass set storage class, 'STANDARD|IA'.
withServerSideEncryption: set server side encryption algorithm, 'AES256'.CreateMultipartUploadOutputTosExceptionpublic UploadPartOutput uploadPart(String bucket, UploadPartInput input, RequestOptionsBuilder... builders) throws TosException
TOSuploadPart in interface TOSbucket - the bucket to operateinput - some params are required, eg, key, uploadID, partSize, partNumber and partNumberbuilders - optional. setting withXXX properties.UploadPartOutputTosExceptionpublic CompleteMultipartUploadOutput completeMultipartUpload(String bucket, CompleteMultipartUploadInput input) throws TosException
TOScompleteMultipartUpload in interface TOSbucket - the bucket to operateinput - key: the object name,
uploadID: the uploadID got from CreateMultipartUpload,
uploadedParts: upload part output got from uploadPart or uploadPartCopyCompleteMultipartUploadOutputTosExceptionpublic AbortMultipartUploadOutput abortMultipartUpload(String bucket, AbortMultipartUploadInput input) throws TosException
TOSabortMultipartUpload in interface TOSbucket - the bucket to operateAbortMultipartUploadOutputTosExceptionpublic ListUploadedPartsOutput listUploadedParts(String bucket, ListUploadedPartsInput input, RequestOptionsBuilder... builders) throws TosException
TOSlistUploadedParts in interface TOSbucket - the bucket to operateinput - key, uploadID and other parametersbuilders - optional. setting withXXX properties.ListUploadedPartsOutputTosExceptionpublic ListMultipartUploadsOutput listMultipartUploads(String bucket, ListMultipartUploadsInput input) throws TosException
TOSlistMultipartUploads in interface TOSbucket - the bucket to operateinput - ListMultipartUploadsInputListMultipartUploadsOutputTosExceptionpublic String preSignedURL(String httpMethod, String bucket, String objectKey, Duration ttl, RequestOptionsBuilder... builders) throws TosException
TOSpreSignedURL in interface TOShttpMethod - the http method in the URL, such as GET, POST, PUT, HEADbucket - the bucket to operateobjectKey - the object namettl - the time-to-live of signed URLbuilders - withVersionID the version id of the objectTosExceptionpublic String getScheme()
public String getHost()
public int getUrlMode()
public TOSClient setUrlMode(int urlMode)
public String getUserAgent()
public Credentials getCredentials()
public TOSClient setCredentials(Credentials credentials)
public Signer getSigner()
public Transport getTransport()
public Config getConfig()
Copyright © 2023. All rights reserved.