public interface OSS
阿里云存储服务(Object Storage Service,简称OSS),是阿里云对外提供的海量,安全,低成本,
高可靠的云存储服务。用户可以通过简单的REST接口,在任何时间、任何地点上传和下载数据,
也可以使用WEB页面对数据进行管理。
基于OSS,用户可以搭建出各种多媒体分享网站、网盘、个人企业数据备份等基于大规模数据的服务。
void switchCredentials(Credentials creds)
creds
- 用户身份认证。void shutdown()
Bucket createBucket(String bucketName) throws OSSException, ClientException
Bucket
。bucketName
- Bucket名称。OSSException
ClientException
Bucket createBucket(CreateBucketRequest createBucketRequest) throws OSSException, ClientException
Bucket
。createBucketRequest
- 请求参数CreateBucketRequest
。OSSException
ClientException
void deleteBucket(String bucketName) throws OSSException, ClientException
Bucket
。bucketName
- Bucket名称。OSSException
ClientException
void deleteBucket(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
。genericRequest
- 请求信息。OSSException
ClientException
List<Bucket> listBuckets() throws OSSException, ClientException
Bucket
的列表。Bucket
的列表。OSSException
ClientException
BucketList listBuckets(String prefix, String marker, Integer maxKeys) throws OSSException, ClientException
Bucket
列表。prefix
- 限定返回的bucket的名字必须以prefix作为前缀,可以为null(表示不设置前缀)marker
- 设定结果从marker之后按字母排序的第一个开始返回,可以为null(表示没有marker的点,从头开始返回)maxKeys
- 限定此次返回bucket的最大数,取值不能大于1000,默认为100,可以为null(表示默认返回最多100个)Bucket
的列表。OSSException
ClientException
BucketList listBuckets(ListBucketsRequest listBucketsRequest) throws OSSException, ClientException
Bucket
列表。listBucketsRequest
- 请求信息Bucket
的列表。OSSException
ClientException
void setBucketAcl(String bucketName, CannedAccessControlList acl) throws OSSException, ClientException
Bucket
的Access Control List(ACL)。bucketName
- Bucket名称。acl
- CannedAccessControlList
中列出的ACL。
如果传入null,则保持Bucket原先的ACL不变。OSSException
ClientException
void setBucketAcl(SetBucketAclRequest setBucketAclRequest) throws OSSException, ClientException
Bucket
的Access Control List(ACL)。bucketName
- Bucket名称。setBucketAclRequest
- 请求信息。OSSException
ClientException
AccessControlList getBucketAcl(String bucketName) throws OSSException, ClientException
Bucket
的Access Control List(ACL)。bucketName
- Bucket名称。AccessControlList
。OSSException
ClientException
AccessControlList getBucketAcl(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
的Access Control List(ACL)。genericRequest
- 请求信息。AccessControlList
。OSSException
ClientException
void setBucketReferer(String bucketName, BucketReferer referer) throws OSSException, ClientException
Bucket
的http referer。bucketName
- Bucket名称。referer
- BucketReferer
。
如果传入null,则表示使用默认值BucketReferer
。OSSException
ClientException
void setBucketReferer(SetBucketRefererRequest setBucketRefererRequest) throws OSSException, ClientException
Bucket
的http referer。bucketName
- Bucket名称。setBucketRefererRequest
- 请求信息。OSSException
ClientException
BucketReferer getBucketReferer(String bucketName) throws OSSException, ClientException
Bucket
的http referer。bucketName
- Bucket名称。BucketReferer
。OSSException
ClientException
BucketReferer getBucketReferer(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
的http referer。genericRequest
- 请求信息。BucketReferer
。OSSException
ClientException
String getBucketLocation(String bucketName) throws OSSException, ClientException
Bucket
所在的数据中心。bucketName
- Bucket名称。OSSException
ClientException
String getBucketLocation(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
所在的数据中心。genericRequest
- 请求信息。OSSException
ClientException
void setBucketTagging(String bucketName, Map<String,String> tags) throws OSSException, ClientException
Bucket
的标签。bucketName
- Bucket名称。tags
- 标签集。OSSException
ClientException
void setBucketTagging(String bucketName, TagSet tagSet) throws OSSException, ClientException
Bucket
的标签。bucketName
- Bucket名称。tagSet
- 标签集。OSSException
ClientException
void setBucketTagging(SetBucketTaggingRequest setBucketTaggingRequest) throws OSSException, ClientException
Bucket
的标签。setBucketTaggingRequest
- 请求信息。OSSException
ClientException
TagSet getBucketTagging(String bucketName) throws OSSException, ClientException
Bucket
的标签。bucketName
- Bucket名称。OSSException
ClientException
TagSet getBucketTagging(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
的标签。genericRequest
- 请求信息。OSSException
ClientException
void deleteBucketTagging(String bucketName) throws OSSException, ClientException
Bucket
的标签。bucketName
- Bucket名称。OSSException
ClientException
void deleteBucketTagging(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
的标签。genericRequest
- 请求信息。OSSException
ClientException
boolean doesBucketExist(String bucketName) throws OSSException, ClientException
Bucket
是否存在。bucketName
- Bucket名称。OSSException
ClientException
boolean doesBucketExist(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
是否存在。genericRequest
- 请求信息。OSSException
ClientException
ObjectListing listObjects(String bucketName) throws OSSException, ClientException
bucketName
- Bucket名称。ObjectListing
OSSException
ClientException
ObjectListing listObjects(String bucketName, String prefix) throws OSSException, ClientException
bucketName
- Bucket名称。prefix
- 限定返回的Object key必须以prefix作为前缀。ObjectListing
OSSException
ClientException
ObjectListing listObjects(ListObjectsRequest listObjectsRequest) throws OSSException, ClientException
listObjectsRequest
- 请求信息。ObjectListing
OSSException
ClientException
PutObjectResult putObject(String bucketName, String key, InputStream input) throws OSSException, ClientException
bucketName
- Bucket名称。key
- object的key。input
- 输入流。OSSException
ClientException
PutObjectResult putObject(String bucketName, String key, InputStream input, ObjectMetadata metadata) throws OSSException, ClientException
bucketName
- Bucket名称。key
- object的key。input
- 输入流。metadata
- object的元信息ObjectMetadata
,若该元信息未包含Content-Length,
则采用chunked编码传输请求数据。OSSException
ClientException
PutObjectResult putObject(String bucketName, String key, File file, ObjectMetadata metadata) throws OSSException, ClientException
Bucket
。bucketName
- Bucket名称。key
- object的key。file
- 指定上传文件。metadata
- object的元信息ObjectMetadata
,若该元信息未包含Content-Length,
则采用chunked编码传输请求数据。OSSException
ClientException
PutObjectResult putObject(String bucketName, String key, File file) throws OSSException, ClientException
Bucket
。bucketName
- Bucket名称。key
- object的key。file
- 指定上传文件。OSSException
ClientException
PutObjectResult putObject(PutObjectRequest putObjectRequest) throws OSSException, ClientException
Bucket
。putObjectRequest
- 请求参数PutObjectRequest
。PutObjectResult
实例。OSSException
ClientException
PutObjectResult putObject(URL signedUrl, String filePath, Map<String,String> requestHeaders) throws OSSException, ClientException
signedUrl
- PUT请求类型的URL签名。filePath
- 上传文件的路径。requestHeaders
- 请求头(包括HTTP标准请求头、用户自定义请求头)。PutObjectResult
实例。OSSException
ClientException
PutObjectResult putObject(URL signedUrl, String filePath, Map<String,String> requestHeaders, boolean useChunkEncoding) throws OSSException, ClientException
signedUrl
- PUT请求类型的URL签名。filePath
- 上传文件的路径。requestHeaders
- 请求头(包括HTTP标准请求头、用户自定义请求头)。useChunkEncoding
- 是否采用chunked编码传输请求数据。PutObjectResult
实例。OSSException
ClientException
PutObjectResult putObject(URL signedUrl, InputStream requestContent, long contentLength, Map<String,String> requestHeaders) throws OSSException, ClientException
signedUrl
- PUT请求类型的URL签名。requestContent
- 请求输入流。contentLength
- 请求输入流的长度。requestHeaders
- 请求头(包括HTTP标准请求头、用户自定义请求头)。PutObjectResult
实例。OSSException
ClientException
PutObjectResult putObject(URL signedUrl, InputStream requestContent, long contentLength, Map<String,String> requestHeaders, boolean useChunkEncoding) throws OSSException, ClientException
signedUrl
- PUT请求类型的URL签名。requestContent
- 请求输入流。contentLength
- 请求输入流的长度,如果采用chunked编码则设置为-1。requestHeaders
- 请求头(包括HTTP标准请求头、用户自定义请求头)。useChunkEncoding
- 是否采用chunked编码传输请求数据。PutObjectResult
实例。OSSException
ClientException
CopyObjectResult copyObject(String sourceBucketName, String sourceKey, String destinationBucketName, String destinationKey) throws OSSException, ClientException
sourceBucketName
- 源Object所在的Bucket的名称。sourceKey
- 源Object的Key。destinationBucketName
- 目标Object所在的Bucket的名称。destinationKey
- 目标Object的Key。CopyObjectResult
实例。OSSException
ClientException
CopyObjectResult copyObject(CopyObjectRequest copyObjectRequest) throws OSSException, ClientException
copyObjectRequest
- 请求参数CopyObjectRequest
实例。OSSException
ClientException
OSSObject getObject(String bucketName, String key) throws OSSException, ClientException
bucketName
- Bucket名称。key
- Object Key。OSSObject
实例。使用完之后需要手动关闭其中的ObjectContent释放请求连接。OSSException
ClientException
ObjectMetadata getObject(GetObjectRequest getObjectRequest, File file) throws OSSException, ClientException
getObjectRequest
- 请求参数GetObjectRequest
。file
- 目标文件。OSSException
ClientException
OSSObject getObject(GetObjectRequest getObjectRequest) throws OSSException, ClientException
getObjectRequest
- 请求参数GetObjectRequest
。OSSObject
实例。使用完之后需要手动关闭其中的ObjectContent释放请求连接。OSSException
ClientException
OSSObject getObject(URL signedUrl, Map<String,String> requestHeaders) throws OSSException, ClientException
OSSObject
。signedUrl
- GET请求类型的URL签名。requestHeaders
- 请求头(包括HTTP标准请求头、用户自定义请求头)。OSSObject
实例。使用完之后需要手动关闭其中的ObjectContent释放请求连接。OSSException
ClientException
SimplifiedObjectMeta getSimplifiedObjectMeta(String bucketName, String key) throws OSSException, ClientException
OSSObject
的基本元信息。
相比Head Object更轻量,仅返回指定Object的少量基本meta信息, 包括该Object的ETag、Size(文件大小)、LastModified(最后修改时间)。
bucketName
- Bucket名称。key
- Object key。OSSObject
的基本元信息SimplifiedObjectMeta
。OSSException
ClientException
SimplifiedObjectMeta getSimplifiedObjectMeta(GenericRequest genericRequest) throws OSSException, ClientException
OSSObject
的基本元信息。
相比Head Object更轻量,仅返回指定Object的少量基本meta信息, 包括该Object的ETag、Size(文件大小)、LastModified(最后修改时间)。
genericRequest
- 请求信息。OSSObject
的基本元信息SimplifiedObjectMeta
。OSSException
ClientException
ObjectMetadata getObjectMetadata(String bucketName, String key) throws OSSException, ClientException
OSSObject
的元数据。bucketName
- Bucket名称。key
- Object key。OSSException
ClientException
ObjectMetadata getObjectMetadata(GenericRequest genericRequest) throws OSSException, ClientException
OSSObject
的元数据。genericRequest
- 请求信息。OSSException
ClientException
AppendObjectResult appendObject(AppendObjectRequest appendObjectRequest) throws OSSException, ClientException
appendObjectRequest
- 请求参数AppendObjectRequest
实例。OSSException
ClientException
void deleteObject(String bucketName, String key) throws OSSException, ClientException
OSSObject
。bucketName
- Bucket名称。key
- Object key。OSSException
ClientException
void deleteObject(GenericRequest genericRequest) throws OSSException, ClientException
OSSObject
。genericRequest
- 请求信息。OSSException
ClientException
DeleteObjectsResult deleteObjects(DeleteObjectsRequest deleteObjectsRequest) throws OSSException, ClientException
OSSObject
。deleteObjectsRequest
- 请求参数DeleteObjectsRequest
实例。OSSException
ClientException
boolean doesObjectExist(String bucketName, String key) throws OSSException, ClientException
bucketName
- Bucket名称。key
- Object Key。OSSException
ClientException
boolean doesObjectExist(GenericRequest genericRequest) throws OSSException, ClientException
OSSObject
在OSS上是否存在。genericRequest
- 请求参数GenericRequest
实例。OSSException
ClientException
boolean doesObjectExist(String bucketName, String key, boolean isOnlyInOSS)
bucketName
- Bucket名称。key
- Object Key。isOnlyInOSS
- true 不受镜像/302等其它跳转的影响,只检查Object是否在OSS中;
false 受镜像/302跳转的影响,如果OSS中不存在,会根据镜像/302的配置检查Object是否存在。@Deprecated boolean doesObjectExist(HeadObjectRequest headObjectRequest) throws OSSException, ClientException
OSSObject
是否存在。headObjectRequest
- 请求参数HeadObjectRequest
实例。OSSException
ClientException
void setObjectAcl(String bucketName, String key, CannedAccessControlList cannedAcl) throws OSSException, ClientException
OSSObject
的Access Control List(ACL)。bucketName
- Bucket名称。key
- Object Key。cannedAcl
- Private/PublicRead/PublicReadWrite中的一种。OSSException
ClientException
void setObjectAcl(SetObjectAclRequest setObjectAclRequest) throws OSSException, ClientException
OSSObject
的Access Control List(ACL)。setObjectAclRequest
- 请求信息。OSSException
ClientException
ObjectAcl getObjectAcl(String bucketName, String key) throws OSSException, ClientException
OSSObject
的Access Control List(ACL)。bucketName
- Bucket名称。key
- Object Key。OSSObject
的Access Control List(ACL)。OSSException
ClientException
ObjectAcl getObjectAcl(GenericRequest genericRequest) throws OSSException, ClientException
OSSObject
的Access Control List(ACL)。bucketName
- Bucket名称。genericRequest
- 请求信息。OSSException
ClientException
RestoreObjectResult restoreObject(String bucketName, String key) throws OSSException, ClientException
bucketName
- Bucket名称。key
- Object Key。RestoreObjectResult
实例。OSSException
ClientException
RestoreObjectResult restoreObject(GenericRequest genericRequest) throws OSSException, ClientException
genericRequest
- 请求信息。RestoreObjectResult
实例。OSSException
ClientException
URL generatePresignedUrl(String bucketName, String key, Date expiration) throws ClientException
OSSObject
的URL。bucketName
- Bucket名称。key
- Object key。expiration
- URL的超时时间。OSSObject
的URL。ClientException
URL generatePresignedUrl(String bucketName, String key, Date expiration, HttpMethod method) throws ClientException
OSSObject
的URL。bucketName
- Bucket名称。key
- Object Key。expiration
- URL的超时时间。method
- HTTP方法,只支持HttpMethod.GET
和HttpMethod.PUT
。OSSObject
的URL。ClientException
URL generatePresignedUrl(GeneratePresignedUrlRequest request) throws ClientException
OSSObject
的URL。request
- GeneratePresignedUrlRequest
对象。OSSObject
的URL。ClientException
void putBucketImage(PutBucketImageRequest request) throws OSSException, ClientException
Bucket
图片处理功能request
- OSSException
ClientException
GetBucketImageResult getBucketImage(String bucketName) throws OSSException, ClientException
Bucket
图片处理功能属性result
- OSSException
ClientException
GetBucketImageResult getBucketImage(String bucketName, GenericRequest genericRequest) throws OSSException, ClientException
Bucket
图片处理功能属性result
- genericRequest
- OSSException
ClientException
void deleteBucketImage(String bucketName) throws OSSException, ClientException
Bucket
图片处理功能void deleteBucketImage(String bucketName, GenericRequest genericRequest) throws OSSException, ClientException
Bucket
图片处理功能genericRequest
- OSSException
ClientException
void deleteImageStyle(String bucketName, String styleName) throws OSSException, ClientException
Bucket
名为styleName 的 stylebucketName
- styleName
- OSSException
ClientException
void deleteImageStyle(String bucketName, String styleName, GenericRequest genericRequest) throws OSSException, ClientException
Bucket
名为styleName 的 stylebucketName
- styleName
- genericRequest
- OSSException
ClientException
void putImageStyle(PutImageStyleRequest putImageStyleRequest) throws OSSException, ClientException
Bucket
图片处理样式putImageStyleRequest
- OSSException
ClientException
GetImageStyleResult getImageStyle(String bucketName, String styleName) throws OSSException, ClientException
Bucket
名为styleName 的样式bucketName
- styleName
- OSSException
ClientException
GetImageStyleResult getImageStyle(String bucketName, String styleName, GenericRequest genericRequest) throws OSSException, ClientException
Bucket
名为styleName 的样式bucketName
- styleName
- genericRequest
- OSSException
ClientException
List<Style> listImageStyle(String bucketName) throws OSSException, ClientException
Bucket
bucketName下的所有样式bucketName
- genericRequest
- OSSException
ClientException
List<Style> listImageStyle(String bucketName, GenericRequest genericRequest) throws OSSException, ClientException
Bucket
bucketName下的所有样式bucketName
- OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void setBucketProcess(SetBucketProcessRequest setBucketProcessRequest) throws OSSException, ClientException
setBucketProcessRequest
- 请求信息。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。BucketProcess getBucketProcess(String bucketName) throws OSSException, ClientException
bucketName
- Bucket名称。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。BucketProcess getBucketProcess(GenericRequest genericRequest) throws OSSException, ClientException
genericRequest
- 请求信息。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。InitiateMultipartUploadResult initiateMultipartUpload(InitiateMultipartUploadRequest request) throws OSSException, ClientException
使用Multipart模式上传数据前,必须先调用该接口来通过OSS初始化一个Multipart上传事件。 该接口会返回一个OSS服务器创建的全局唯一的Upload ID,用于标识本次Multipart上传事件。 用户可以根据这个ID来发起相关的操作,如中止、查询Multipart上传等。
此方法对应的操作为非幂等操作,SDK不会对其进行重试(即使设置最大重试次数大于0也不会重试)
request
- InitiateMultipartUploadRequest
对象。ClientException
OSSException
MultipartUploadListing listMultipartUploads(ListMultipartUploadsRequest request) throws OSSException, ClientException
即已经被初始化的 Multipart Upload 但是未被完成或被终止的 Multipart上传事件。 OSS返回的罗列结果中最多会包含1000个Multipart上传事件。
request
- ListMultipartUploadsRequest
对象。MultipartUploadListing
。ClientException
OSSException
PartListing listParts(ListPartsRequest request) throws OSSException, ClientException
request
- ListPartsRequest
对象。ClientException
OSSException
UploadPartResult uploadPart(UploadPartRequest request) throws OSSException, ClientException
request
- UploadPartRequest
对象。UploadPartResult
。ClientException
OSSException
UploadPartCopyResult uploadPartCopy(UploadPartCopyRequest request) throws OSSException, ClientException
request
- 分片拷贝请求参数。OSSException
ClientException
void abortMultipartUpload(AbortMultipartUploadRequest request) throws OSSException, ClientException
request
- AbortMultipartUploadRequest
对象。ClientException
OSSException
CompleteMultipartUploadResult completeMultipartUpload(CompleteMultipartUploadRequest request) throws OSSException, ClientException
在将所有数据Part 都上传完成后,可以调用 Complete Multipart Upload API 来完成整个文件的 Multipart Upload。在执行该操作时,用户必须提供所有有效 的数据Part的列表(包括part号码和ETAG); OSS收到用户提交的Part列表后, 会逐一验证每个数据 Part 的有效性。当所有的数据 Part 验证通过后,OSS 将把 这些数据part组合成一个完整的 Object。
此方法对应的操作为非幂等操作,SDK不会对其进行重试(即使设置最大重试次数大于0也不会重试)
request
- CompleteMultipartUploadRequest
对象。ClientException
OSSException
void setBucketCORS(SetBucketCORSRequest request) throws OSSException, ClientException
request
- SetBucketCORSRequest
}OSSException
ClientException
List<SetBucketCORSRequest.CORSRule> getBucketCORSRules(String bucketName) throws OSSException, ClientException
bucketName
- OSSException
ClientException
List<SetBucketCORSRequest.CORSRule> getBucketCORSRules(GenericRequest genericRequest) throws OSSException, ClientException
genericRequest
- 请求信息。OSSException
ClientException
void deleteBucketCORSRules(String bucketName) throws OSSException, ClientException
bucketName
- OSSException
ClientException
void deleteBucketCORSRules(GenericRequest genericRequest) throws OSSException, ClientException
genericRequest
- 请求信息。OSSException
ClientException
@Deprecated ResponseMessage optionsObject(OptionsRequest request) throws OSSException, ClientException
void setBucketLogging(SetBucketLoggingRequest request) throws OSSException, ClientException
Bucket
的访问日志记录功能。
这个功能开启后,OSS将自动记录访问这个Bucket
请求的详细信息,并按照用户指定的规则,
以小时为单位,将访问日志作为一个Object写入用户指定的Bucket
。request
- PutBucketLoggingRequest
对象。OSSException
ClientException
BucketLoggingResult getBucketLogging(String bucketName) throws OSSException, ClientException
Bucket
的访问日志配置。bucketName
- OSSException
ClientException
BucketLoggingResult getBucketLogging(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
的访问日志配置。genericRequest
- 请求信息。OSSException
ClientException
void deleteBucketLogging(String bucketName) throws OSSException, ClientException
Bucket
的访问日志记录功能。bucketName
- OSSException
ClientException
void deleteBucketLogging(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
的访问日志记录功能。genericRequest
- 请求信息。OSSException
ClientException
void setBucketWebsite(SetBucketWebsiteRequest setBucketWebSiteRequest) throws OSSException, ClientException
Bucket
设置成静态网站托管模式。setBucketWebSiteRequest
- OSSException
ClientException
BucketWebsiteResult getBucketWebsite(String bucketName) throws OSSException, ClientException
Bucket
的静态网站托管状态。bucketName
- OSSException
ClientException
BucketWebsiteResult getBucketWebsite(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
的静态网站托管状态。genericRequest
- 请求信息。OSSException
ClientException
void deleteBucketWebsite(String bucketName) throws OSSException, ClientException
Bucket
的静态网站托管模式。bucketName
- OSSException
ClientException
void deleteBucketWebsite(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
的静态网站托管模式。genericRequest
- 请求信息。OSSException
ClientException
String generatePostPolicy(Date expiration, PolicyConditions conds) throws ClientException
expiration
- policy过期时间。conds
- policy条件列表。ClientException
String calculatePostSignature(String postPolicy)
postPolicy
- 由generatePostPolicy(Date, PolicyConditions)
生成的policy字符串。void setBucketLifecycle(SetBucketLifecycleRequest setBucketLifecycleRequest) throws OSSException, ClientException
Bucket
的Lifecycle规则。setBucketLifecycleRequest
- 请求参数。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。List<LifecycleRule> getBucketLifecycle(String bucketName) throws OSSException, ClientException
Bucket
的Lifecycle规则列表。bucketName
- 指定Bucket名称。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。List<LifecycleRule> getBucketLifecycle(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
的Lifecycle规则列表。genericRequest
- 请求信息。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void deleteBucketLifecycle(String bucketName) throws OSSException, ClientException
Bucket
的Lifecycle规则。bucketName
- 指定Bucket名称。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void deleteBucketLifecycle(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
的Lifecycle规则。genericRequest
- 请求信息。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void addBucketReplication(AddBucketReplicationRequest addBucketReplicationRequest) throws OSSException, ClientException
Bucket
的跨区域复制规则。addBucketReplicationRequest
- 请求参数。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。List<ReplicationRule> getBucketReplication(String bucketName) throws OSSException, ClientException
Bucket
已设置的跨区域复制规则。bucketName
- 指定Bucket名称。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。List<ReplicationRule> getBucketReplication(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
已设置的跨区域复制规则。genericRequest
- 请求信息。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void deleteBucketReplication(String bucketName, String replicationRuleID) throws OSSException, ClientException
Bucket
的跨区域复制并删除复制配置。bucketName
- 指定Bucket名称。replicationRuleID
- 复制规则对应的ID。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void deleteBucketReplication(DeleteBucketReplicationRequest deleteBucketReplicationRequest) throws OSSException, ClientException
Bucket
的跨区域复制并删除复制配置。deleteBucketReplicationRequest
- 请求信息。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。BucketReplicationProgress getBucketReplicationProgress(String bucketName, String replicationRuleID) throws OSSException, ClientException
Bucket
的跨区域复制进度。bucketName
- 指定Bucket名称。replicationRuleID
- 复制规则对应的ID。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。BucketReplicationProgress getBucketReplicationProgress(GetBucketReplicationProgressRequest getBucketReplicationProgressRequest) throws OSSException, ClientException
Bucket
的跨区域复制进度。genericRequest
- 请求信息。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。List<String> getBucketReplicationLocation(String bucketName) throws OSSException, ClientException
Bucket
所在的数据中心配对的可复制到的数据中心。bucketName
- 指定Bucket名称。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。List<String> getBucketReplicationLocation(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
的所在的数据中心配对的可复制到的数据中心。genericRequest
- 请求信息。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void addBucketCname(AddBucketCnameRequest addBucketCnameRequest) throws OSSException, ClientException
Bucket
的cname。setBucketCnameRequest
- 请求参数。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。List<CnameConfiguration> getBucketCname(String bucketName) throws OSSException, ClientException
Bucket
已设置的cname。bucketName
- 指定Bucket名称。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。List<CnameConfiguration> getBucketCname(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
已设置的cname。genericRequest
- 请求信息。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void deleteBucketCname(String bucketName, String domain) throws OSSException, ClientException
Bucket
的指定的cname。bucketName
- 指定Bucket名称。domain
- cname。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void deleteBucketCname(DeleteBucketCnameRequest deleteBucketCnameRequest) throws OSSException, ClientException
Bucket
的指定的cname。deleteBucketCnameRequest
- 删除cname请求。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。BucketInfo getBucketInfo(String bucketName) throws OSSException, ClientException
Bucket
的信息。bucketName
- 指定Bucket名称。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。BucketInfo getBucketInfo(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
的信息。genericRequest
- 请求信息。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。BucketStat getBucketStat(String bucketName) throws OSSException, ClientException
Bucket
的存储信息。bucketName
- 指定Bucket名称。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。BucketStat getBucketStat(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
的存储信息。genericRequest
- 请求信息。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void setBucketStorageCapacity(String bucketName, UserQos userQos) throws OSSException, ClientException
Bucket
的容量。bucketName
- 指定Bucket名称。userQos
- 包括的容量的Bucket Qos。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void setBucketStorageCapacity(SetBucketStorageCapacityRequest setBucketStorageCapacityRequest) throws OSSException, ClientException
Bucket
的容量。setBucketStorageCapacityRequest
- 请求信息。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。UserQos getBucketStorageCapacity(String bucketName) throws OSSException, ClientException
Bucket
的容量。bucketName
- 指定Bucket名称。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。UserQos getBucketStorageCapacity(GenericRequest genericRequest) throws OSSException, ClientException
Bucket
的容量。genericRequest
- 请求信息。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。UploadFileResult uploadFile(UploadFileRequest uploadFileRequest) throws Throwable
uploadFileRequest上传文件请求。
- Throwable
DownloadFileResult downloadFile(DownloadFileRequest downloadFileRequest) throws Throwable
downloadFileRequest分片下载请求。
- Throwable
CreateLiveChannelResult createLiveChannel(CreateLiveChannelRequest createLiveChannelRequest) throws OSSException, ClientException
createLiveChannelRequest
- 请求参数。CreateLiveChannelResult
实例。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void setLiveChannelStatus(String bucketName, String liveChannel, LiveChannelStatus status) throws OSSException, ClientException
bucketName
- Bucket名称。liveChannel
- Live Channel名称。status
- Live Channel状态,可选值包括enabled、disabled。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void setLiveChannelStatus(SetLiveChannelRequest setLiveChannelRequest) throws OSSException, ClientException
setLiveChannelRequest
- 请求参数。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。LiveChannelInfo getLiveChannelInfo(String bucketName, String liveChannel) throws OSSException, ClientException
bucketName
- Bucket名称。liveChannel
- Live Channel名称。LiveChannelInfo
实例。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。LiveChannelInfo getLiveChannelInfo(LiveChannelGenericRequest liveChannelGenericRequest) throws OSSException, ClientException
liveChannelGenericRequest
- 请求参数。LiveChannelInfo
实例。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。LiveChannelStat getLiveChannelStat(String bucketName, String liveChannel) throws OSSException, ClientException
bucketName
- Bucket名称。liveChannel
- Live Channel名称。LiveChannelStat
实例。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。LiveChannelStat getLiveChannelStat(LiveChannelGenericRequest liveChannelGenericRequest) throws OSSException, ClientException
liveChannelGenericRequest
- 请求参数。LiveChannelStat
实例。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void deleteLiveChannel(String bucketName, String liveChannel) throws OSSException, ClientException
bucketName
- Bucket名称。liveChannel
- Live Channel名称。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void deleteLiveChannel(LiveChannelGenericRequest liveChannelGenericRequest) throws OSSException, ClientException
liveChannelGenericRequest
- 请求参数。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。List<LiveChannel> listLiveChannels(String bucketName) throws OSSException, ClientException
LiveChannel
的列表。bucketName
- Bucket名称。LiveChannel
的列表。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。LiveChannelListing listLiveChannels(ListLiveChannelsRequest listLiveChannelRequest) throws OSSException, ClientException
LiveChannel
列表。listLiveChannelRequest
- 请求参数。LiveChannel
列表。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。List<LiveRecord> getLiveChannelHistory(String bucketName, String liveChannel) throws OSSException, ClientException
bucketName
- Bucket名称。liveChannel
- Live Channel名称。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。List<LiveRecord> getLiveChannelHistory(LiveChannelGenericRequest liveChannelGenericRequest) throws OSSException, ClientException
liveChannelGenericRequest
- 请求参数。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void generateVodPlaylist(String bucketName, String liveChannelName, String PlaylistName, long startTime, long endTime) throws OSSException, ClientException
bucketName
- Bucket名称。liveChannel
- Live Channel名称。PlaylistName
- 生成的点播用m3u8文件的basename,例如playlist.m3u8。startTime
- 播放列表的开始时间,格式采用epoch time,例如1459922563。endTime
- 播放列表的结束时间,格式采用epoch time,例如1459922563。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void generateVodPlaylist(GenerateVodPlaylistRequest generateVodPlaylistRequest) throws OSSException, ClientException
generateVodPlaylistRequest
- 请求参数。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。String generateRtmpUri(String bucketName, String liveChannelName, String PlaylistName, long expires) throws OSSException, ClientException
bucketName
- Bucket名称。liveChannel
- Live Channel名称。PlaylistName
- 生成的点播用m3u8文件的basename,例如playlist.m3u8。expires
- 期望的过期时间,格式采用epoch time,例如1459922563。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。String generateRtmpUri(GenerateRtmpUriRequest generatePushflowUrlRequest) throws OSSException, ClientException
generatePushflowUrlRequest
- 请求参数。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void createSymlink(String bucketName, String symlink, String target) throws OSSException, ClientException
bucketName
- Bucket名称。symlink
- 符号链接。target
- 目标文件。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void createSymlink(CreateSymlinkRequest createSymlinkRequest) throws OSSException, ClientException
createSymlinkRequest
- 创建符号链接请求。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。OSSSymlink getSymlink(String bucketName, String symlink) throws OSSException, ClientException
bucketName
- Bucket名称。symlink
- 符号链接。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。OSSSymlink getSymlink(GenericRequest genericRequest) throws OSSException, ClientException
genericRequest
- 请求,包括bucketName、symLink。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。GenericResult processObject(ProcessObjectRequest processObjectRequest) throws OSSException, ClientException
处理结果GenericResult
实例,使用完之后需要手动关闭释放请求连接,
请调用getResponse().getContent().close()关闭。
processObjectRequest
- 请求,包括指定的处理方式process。GenericResult
实例。使用完之后需要手动关闭释放请求连接。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。void createUdf(CreateUdfRequest createUdfRequest) throws OSSException, ClientException
createUdfRequest
- 请求。OSSException
- OSS Server异常信息。ClientException
- OSS Client异常信息。UdfInfo getUdfInfo(UdfGenericRequest genericRequest) throws OSSException, ClientException
List<UdfInfo> listUdfs() throws OSSException, ClientException
void deleteUdf(UdfGenericRequest genericRequest) throws OSSException, ClientException
void uploadUdfImage(UploadUdfImageRequest uploadUdfImageRequest) throws OSSException, ClientException
List<UdfImageInfo> getUdfImageInfo(UdfGenericRequest genericRequest) throws OSSException, ClientException
void deleteUdfImage(UdfGenericRequest genericRequest) throws OSSException, ClientException
void createUdfApplication(CreateUdfApplicationRequest createUdfApplicationRequest) throws OSSException, ClientException
UdfApplicationInfo getUdfApplicationInfo(UdfGenericRequest genericRequest) throws OSSException, ClientException
List<UdfApplicationInfo> listUdfApplications() throws OSSException, ClientException
void deleteUdfApplication(UdfGenericRequest genericRequest) throws OSSException, ClientException
void upgradeUdfApplication(UpgradeUdfApplicationRequest upgradeUdfApplicationRequest) throws OSSException, ClientException
void resizeUdfApplication(ResizeUdfApplicationRequest resizeUdfApplicationRequest) throws OSSException, ClientException
UdfApplicationLog getUdfApplicationLog(GetUdfApplicationLogRequest getUdfApplicationLogRequest) throws OSSException, ClientException
Copyright © 2017. All Rights Reserved.