public class ObsClient extends com.obs.services.internal.ObsService implements Closeable
构造器和说明 |
---|
ObsClient(ObsConfiguration config)
构造函数
|
ObsClient(String endPoint)
构造函数
|
ObsClient(String accessKey,
String secretKey,
ObsConfiguration config)
构造函数
|
ObsClient(String accessKey,
String secretKey,
String endPoint)
构造函数
|
ObsClient(String accessKey,
String secretKey,
String securityToken,
ObsConfiguration config)
构造函数
|
ObsClient(String accessKey,
String secretKey,
String securityToken,
String endPoint)
构造函数
|
_createPostSignature, _createTemporarySignature, abortMultipartUploadImpl, abortMultipartUploadImplSilent, appendObjectImpl, asserParameterNotNull, asserParameterNotNull, asserParameterNotNull2, completeMultipartUploadImpl, copyObjectImpl, copyPartImpl, createBucketImpl, createRequestBody, createV4TemporarySignature, deleteBucketCorsImpl, deleteBucketImpl, deleteBucketLifecycleConfigurationImpl, deleteBucketPolicyImpl, deleteBucketReplicationConfigurationImpl, deleteBucketTaggingImpl, deleteBucketWebsiteConfigurationImpl, deleteObjectImpl, deleteObjectsImpl, downloadFileResume, getApiVersion, getBucketAclImpl, getBucketCorsImpl, getBucketLifecycleConfigurationImpl, getBucketLocationImpl, getBucketLoggingConfigurationImpl, getBucketMetadataImpl, getBucketNotificationConfigurationImpl, getBucketPolicyImpl, getBucketQuotaImpl, getBucketReplicationConfigurationImpl, getBucketStorageInfoImpl, getBucketStoragePolicyImpl, getBucketTaggingImpl, getBucketVersioningImpl, getBucketWebsiteConfigurationImpl, getCredential, getObjectAclImpl, getObjectImpl, getObjectImpl, getObjectMetadataImpl, headBucketImpl, initiateMultipartUploadImpl, listAllBucketsImpl, listMultipartUploadsImpl, listObjectsImpl, listPartsImpl, listVersionsImpl, optionsImpl, putObjectImpl, restoreObjectImpl, setBucketAclImpl, setBucketCorsImpl, setBucketLifecycleConfigurationImpl, setBucketLoggingConfigurationImpl, setBucketNotificationImpl, setBucketPolicyImpl, setBucketQuotaImpl, setBucketReplicationConfigurationImpl, setBucketStorageImpl, setBucketTaggingImpl, setBucketVersioningImpl, setBucketWebsiteConfigurationImpl, setObjectAclImpl, uploadFileResume, uploadPartImpl, verifyResponseContentType
addRequestHeadersToConnection, addRequestParametersToUrlPath, authorizeHttpRequest, convertHeadersToMap, getApiVersionCache, getEndpoint, getHttpPort, getHttpsOnly, getHttpsPort, getIConvertor, getIHeaders, getProviderCredentials, getRestHeaderPrefix, getRestMetadataPrefix, getXmlResponseSaxParser, initHttpClient, isAuthTypeNegotiation, isCname, isKeepAlive, isPathStyle, performRequest, performRequest, performRequestAsync, performRequestWithoutSignature, performRestDelete, performRestDelete, performRestForApiVersion, performRestGet, performRestHead, performRestOptions, performRestPost, performRestPut, renameMetadataKeys, retryRequest, setProviderCredentials, setupConnection, shutdown, shutdownImpl, sleepOnInternalError
public ObsClient(String endPoint)
endPoint
- OBS服务地址public ObsClient(ObsConfiguration config)
config
- OBS客户端配置参数public ObsClient(String accessKey, String secretKey, String endPoint)
accessKey
- 访问密钥中的AKsecretKey
- 访问密钥中的SKendPoint
- OBS服务地址public ObsClient(String accessKey, String secretKey, ObsConfiguration config)
accessKey
- 访问密钥中的AKsecretKey
- 访问密钥中的SKconfig
- OBS客户端配置参数public ObsClient(String accessKey, String secretKey, String securityToken, String endPoint)
accessKey
- 临时访问密钥中的AKsecretKey
- 临时访问密钥中的SKsecurityToken
- 安全令牌endPoint
- OBS的服务地址public ObsClient(String accessKey, String secretKey, String securityToken, ObsConfiguration config)
accessKey
- 临时访问密钥中的AKsecretKey
- 临时访问密钥中的SKsecurityToken
- 安全令牌config
- OBS客户端配置参数public void refresh(String accessKey, String secretKey, String securityToken)
accessKey
- 临时访问密钥中的AKsecretKey
- 临时访问密钥中的SKsecurityToken
- 安全令牌public String createSignedUrl(HttpMethodEnum method, String bucketName, String objectKey, SpecialParamEnum specialParam, Date expiryTime, Map<String,String> headers, Map<String,Object> queryParams) throws ObsException
method
- Http请求方法bucketName
- 桶名objectKey
- 对象名specialParam
- 特殊操作符expiryTime
- 临时授权的有效截止日期headers
- 头信息queryParams
- 查询参数信息ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public String createSignedUrl(HttpMethodEnum method, String bucketName, String objectKey, SpecialParamEnum specialParam, long expires, Map<String,String> headers, Map<String,Object> queryParams)
method
- Http请求方法bucketName
- 桶名objectKey
- 对象名specialParam
- 特殊操作符expires
- 临时授权的有效时间,单位:秒,默认值:300headers
- 头信息queryParams
- 查询参数信息ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public V4TemporarySignatureResponse createV4TemporarySignature(V4TemporarySignatureRequest request)
@Deprecated public V4PostSignatureResponse createV4PostSignature(String acl, String contentType, long expires, String bucketName, String objectKey) throws ObsException
ObsException
@Deprecated public V4PostSignatureResponse createV4PostSignature(long expires, String bucketName, String objectKey) throws ObsException
ObsException
@Deprecated public V4PostSignatureResponse createV4PostSignature(V4PostSignatureRequest request) throws ObsException
ObsException
public TemporarySignatureResponse createTemporarySignature(TemporarySignatureRequest request)
request
- 临时授权访问的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public PostSignatureResponse createPostSignature(String acl, String contentType, long expires, String bucketName, String objectKey) throws ObsException
acl
- 对象的访问权限contentType
- 对象的MIME类型expires
- 有效时间,单位:秒bucketName
- 桶名objectKey
- 对象名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public PostSignatureResponse createPostSignature(long expires, String bucketName, String objectKey) throws ObsException
expires
- 有效时间,单位:秒bucketName
- 桶名objectKey
- 对象名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public PostSignatureResponse createPostSignature(PostSignatureRequest request) throws ObsException
request
- 基于V4的浏览器表单授权访问请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObsBucket createBucket(String bucketName) throws ObsException
桶命名规范:
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObsBucket createBucket(String bucketName, String location) throws ObsException
桶命名规范:
bucketName
- 桶名location
- 创建桶的区域, 如果使用的终端节点归属于默认区域,可以不携带此参数;如果使用的终端节点归属于其他区域,则必须携带此参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObsBucket createBucket(ObsBucket bucket) throws ObsException
桶命名规范:
bucket
- 桶信息,包含请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObsBucket createBucket(CreateBucketRequest request) throws ObsException
桶命名规范:
request
- 创建桶请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public ObsBucket createBucket(S3Bucket bucket) throws ObsException
ObsException
@Deprecated public List<S3Bucket> listBuckets() throws ObsException
ObsException
public List<ObsBucket> listBuckets(ListBucketsRequest request) throws ObsException
request
- 获取桶列表请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ListBucketsResult listBucketsV2(ListBucketsRequest request) throws ObsException
request
- 获取桶列表请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse deleteBucket(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObjectListing listObjects(ListObjectsRequest request) throws ObsException
request
- 列举桶内对象请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObjectListing listObjects(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public boolean headBucket(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public ListVersionsResult listVersions(String bucketName, String prefix, String delimiter, String keyMarker, String versionIdMarker, long maxKeys, String nextVersionIdMarker) throws ObsException
bucketName
- 桶名prefix
- 列举多版本对象时的对象名前缀delimiter
- 对象名进行分组的字符keyMarker
- 列举多版本对象的起始位置(按对象名排序)versionIdMarker
- 列举多版本对象的起始位置(按对象版本号排序)maxKeys
- 列举多版本对象的最大条目数nextVersionIdMarker
- 废弃字段。ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ListVersionsResult listVersions(ListVersionsRequest request) throws ObsException
request
- 列举桶内多版本对象请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ListVersionsResult listVersions(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ListVersionsResult listVersions(String bucketName, long maxKeys) throws ObsException
bucketName
- 桶名maxKeys
- 列举多版本对象的最大条目数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ListVersionsResult listVersions(String bucketName, String prefix, String delimiter, String keyMarker, String versionIdMarker, long maxKeys) throws ObsException
bucketName
- 桶名prefix
- 列举多版本对象时的对象名前缀delimiter
- 对象名进行分组的字符keyMarker
- 列举多版本对象的起始位置(按对象名排序)versionIdMarker
- 列举多版本对象的起始位置(按对象版本号排序)maxKeys
- 列举多版本对象的最大条目数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public BucketMetadataInfoResult getBucketMetadata(BucketMetadataInfoRequest request) throws ObsException
request
- 获取桶元数据的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public AccessControlList getBucketAcl(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public HeaderResponse setBucketAcl(String bucketName, String cannedACL, AccessControlList acl) throws ObsException
bucketName
- 桶名cannedACL
- 预定义访问策略acl
- 访问权限 ( acl和cannedACL不能同时使用)ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse setBucketAcl(String bucketName, AccessControlList acl) throws ObsException
bucketName
- 桶名acl
- 访问权限ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public String getBucketLocation(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public BucketLocationResponse getBucketLocationV2(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public BucketStorageInfo getBucketStorageInfo(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public BucketQuota getBucketQuota(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse setBucketQuota(String bucketName, BucketQuota bucketQuota) throws ObsException
bucketName
- 桶名bucketQuota
- 桶配额ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public BucketStoragePolicyConfiguration getBucketStoragePolicy(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse setBucketStoragePolicy(String bucketName, BucketStoragePolicyConfiguration bucketStorage) throws ObsException
bucketName
- 桶名bucketStorage
- 桶的存储策略ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse setBucketCors(String bucketName, BucketCors bucketCors) throws ObsException
bucketName
- 桶名bucketCors
- CORS配置ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public HeaderResponse setBucketCors(String bucketName, S3BucketCors s3BucketCors) throws ObsException
ObsException
public BucketCors getBucketCors(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse deleteBucketCors(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public OptionsInfoResult optionsBucket(String bucketName, OptionsInfoRequest optionInfo) throws ObsException
bucketName
- 桶名optionInfo
- OPTIONS桶的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public OptionsInfoResult optionsObject(String bucketName, String objectKey, OptionsInfoRequest optionInfo) throws ObsException
bucketName
- 桶名objectKey
- 对象名optionInfo
- OPTIONS对象的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public BucketLoggingConfiguration getBucketLoggingConfiguration(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public BucketLoggingConfiguration getBucketLogging(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse setBucketLoggingConfiguration(String bucketName, BucketLoggingConfiguration loggingConfiguration, boolean updateTargetACLifRequired) throws ObsException
ObsException
@Deprecated public HeaderResponse setBucketLoggingConfiguration(String bucketName, BucketLoggingConfiguration loggingConfiguration) throws ObsException
ObsException
public HeaderResponse setBucketLogging(String bucketName, BucketLoggingConfiguration loggingConfiguration) throws ObsException
bucketName
- 桶名loggingConfiguration
- 日志管理配置ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public HeaderResponse setBucketVersioning(String bucketName, String status) throws ObsException
ObsException
public HeaderResponse setBucketVersioning(String bucketName, BucketVersioningConfiguration versioningConfiguration) throws ObsException
bucketName
- 桶名versioningConfiguration
- 桶的多版本状态配置ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public BucketVersioningConfiguration getBucketVersioning(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public LifecycleConfiguration getBucketLifecycleConfiguration(String bucketName) throws ObsException
ObsException
public LifecycleConfiguration getBucketLifecycle(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public HeaderResponse setBucketLifecycleConfiguration(String bucketName, LifecycleConfiguration lifecycleConfig) throws ObsException
ObsException
public HeaderResponse setBucketLifecycle(String bucketName, LifecycleConfiguration lifecycleConfig) throws ObsException
bucketName
- 桶名lifecycleConfig
- 桶的生命周期配置ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public HeaderResponse deleteBucketLifecycleConfiguration(String bucketName) throws ObsException
ObsException
public HeaderResponse deleteBucketLifecycle(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public String getBucketPolicy(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public BucketPolicyResponse getBucketPolicyV2(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse setBucketPolicy(String bucketName, String policy) throws ObsException
bucketName
- 桶名policy
- 桶策略,JSON格式字符串ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse deleteBucketPolicy(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public WebsiteConfiguration getBucketWebsiteConfiguration(String bucketName) throws ObsException
ObsException
public WebsiteConfiguration getBucketWebsite(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public HeaderResponse setBucketWebsiteConfiguration(String bucketName, WebsiteConfiguration websiteConfig) throws ObsException
ObsException
public HeaderResponse setBucketWebsite(String bucketName, WebsiteConfiguration websiteConfig) throws ObsException
bucketName
- 桶名websiteConfig
- 桶的website(托管)配置ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public HeaderResponse deleteBucketWebsiteConfiguration(String bucketName) throws ObsException
ObsException
public HeaderResponse deleteBucketWebsite(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public BucketTagInfo getBucketTagging(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse setBucketTagging(String bucketName, BucketTagInfo bucketTagInfo) throws ObsException
bucketName
- 桶名bucketTagInfo
- 桶标签ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse deleteBucketTagging(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public HeaderResponse setBucketReplicationConfiguration(String bucketName, ReplicationConfiguration replicationConfiguration) throws ObsException
ObsException
public HeaderResponse setBucketReplication(String bucketName, ReplicationConfiguration replicationConfiguration) throws ObsException
bucketName
- 桶名replicationConfiguration
- 跨Region复制配置ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public ReplicationConfiguration getBucketReplicationConfiguration(String bucketName) throws ObsException
ObsException
public ReplicationConfiguration getBucketReplication(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public HeaderResponse deleteBucketReplicationConfiguration(String bucketName) throws ObsException
ObsException
public HeaderResponse deleteBucketReplication(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public BucketNotificationConfiguration getBucketNotification(String bucketName) throws ObsException
bucketName
- 桶名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse setBucketNotification(String bucketName, BucketNotificationConfiguration bucketNotificationConfiguration) throws ObsException
bucketName
- 桶名bucketNotificationConfiguration
- 桶的消息通知配置ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public PutObjectResult putObject(String bucketName, String objectKey, InputStream input, ObjectMetadata metadata) throws ObsException
bucketName
- 桶名objectKey
- 对象名input
- 待上传的数据流metadata
- 对象的属性ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public PutObjectResult putObject(String bucketName, String objectKey, InputStream input) throws ObsException
bucketName
- 桶名objectKey
- 对象名input
- 待上传的数据流ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public PutObjectResult putObject(PutObjectRequest request) throws ObsException
request
- 上传对象请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public PutObjectResult putObject(String bucketName, String objectKey, File file) throws ObsException
bucketName
- 桶名objectKey
- 对象名file
- 待上传的文件ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public PutObjectResult putObject(String bucketName, String objectKey, File file, ObjectMetadata metadata) throws ObsException
bucketName
- 桶名objectKey
- 对象名file
- 待上传的文件metadata
- 对象的属性ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public AppendObjectResult appendObject(AppendObjectRequest request) throws ObsException
request
- 追加上传请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public CompleteMultipartUploadResult uploadFile(UploadFileRequest uploadFileRequest) throws ObsException
uploadFileRequest
- 上传文件请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public DownloadFileResult downloadFile(DownloadFileRequest downloadFileRequest) throws ObsException
downloadFileRequest
- 下载文件的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObsObject getObject(GetObjectRequest request) throws ObsException
request
- 下载对象的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObsObject getObject(String bucketName, String objectKey, String versionId) throws ObsException
bucketName
- 桶名objectKey
- 对象名versionId
- 对象版本号ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObsObject getObject(String bucketName, String objectKey) throws ObsException
bucketName
- 桶名objectKey
- 对象名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObjectMetadata getObjectMetadata(GetObjectMetadataRequest request) throws ObsException
request
- 获取对象属性的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObjectMetadata getObjectMetadata(String bucketName, String objectKey, String versionId) throws ObsException
bucketName
- 桶名objectKey
- 对象名versionId
- 对象版本号ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ObjectMetadata getObjectMetadata(String bucketName, String objectKey) throws ObsException
bucketName
- 桶名objectKey
- 对象名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public RestoreObjectRequest.RestoreObjectStatus restoreObject(RestoreObjectRequest request) throws ObsException
request
- 取回归档存储对象的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public DeleteObjectResult deleteObject(String bucketName, String objectKey, String versionId) throws ObsException
bucketName
- 桶名objectKey
- 对象名versionId
- 对象版本号ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public DeleteObjectResult deleteObject(String bucketName, String objectKey) throws ObsException
bucketName
- 桶名objectKey
- 对象名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public DeleteObjectsResult deleteObjects(DeleteObjectsRequest deleteObjectsRequest) throws ObsException
deleteObjectsRequest
- 批量删除对象的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public AccessControlList getObjectAcl(String bucketName, String objectKey, String versionId) throws ObsException
bucketName
- 桶名objectKey
- 对象名versionId
- 对象版本号ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public AccessControlList getObjectAcl(String bucketName, String objectKey) throws ObsException
bucketName
- 桶名objectKey
- 对象名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常@Deprecated public HeaderResponse setObjectAcl(String bucketName, String objectKey, String cannedACL, AccessControlList acl, String versionId) throws ObsException
bucketName
- 桶名objectKey
- 对象名cannedACL
- 预定义访问策略acl
- 访问权限(acl和cannedACL不能同时使用)versionId
- 对象版本号ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse setObjectAcl(String bucketName, String objectKey, AccessControlList acl, String versionId) throws ObsException
bucketName
- 桶名objectKey
- 对象名acl
- 访问权限versionId
- 对象版本号ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse setObjectAcl(String bucketName, String objectKey, AccessControlList acl) throws ObsException
bucketName
- 桶名objectKey
- 对象名acl
- 访问权限ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public CopyObjectResult copyObject(CopyObjectRequest request) throws ObsException
request
- 复制对象请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public CopyObjectResult copyObject(String sourceBucketName, String sourceObjectKey, String destBucketName, String destObjectKey) throws ObsException
sourceBucketName
- 源桶名sourceObjectKey
- 源对象名destBucketName
- 目标桶名destObjectKey
- 目标对象名ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public InitiateMultipartUploadResult initiateMultipartUpload(InitiateMultipartUploadRequest request) throws ObsException
request
- 初始化分段上传任务的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public HeaderResponse abortMultipartUpload(AbortMultipartUploadRequest request) throws ObsException
request
- 取消分段上传任务的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public UploadPartResult uploadPart(String bucketName, String objectKey, String uploadId, int partNumber, InputStream input) throws ObsException
bucketName
- 桶名objectKey
- 对象名uploadId
- 分段上传任务的ID号partNumber
- 分段号input
- 待上传的数据流ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public UploadPartResult uploadPart(String bucketName, String objectKey, String uploadId, int partNumber, File file) throws ObsException
bucketName
- 桶名objectKey
- 对象名uploadId
- 分段上传任务的ID号partNumber
- 分段号file
- 待上传的文件ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public UploadPartResult uploadPart(UploadPartRequest request) throws ObsException
request
- 上传段的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public CopyPartResult copyPart(CopyPartRequest request) throws ObsException
request
- 复制段的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public CompleteMultipartUploadResult completeMultipartUpload(CompleteMultipartUploadRequest request) throws ObsException
request
- 合并段的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public ListPartsResult listParts(ListPartsRequest request) throws ObsException
request
- 列举已上传段的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public MultipartUploadListing listMultipartUploads(ListMultipartUploadsRequest request) throws ObsException
request
- 列举分段上传任务的请求参数ObsException
- OBS SDK自定义异常,当调用接口失败、访问OBS失败时抛出该异常public void close() throws IOException
close
在接口中 Closeable
close
在接口中 AutoCloseable
IOException
public String base64Md5(InputStream is, long length, long offset) throws NoSuchAlgorithmException, IOException
public String base64Md5(InputStream is) throws NoSuchAlgorithmException, IOException
Copyright © 2018. All rights reserved.