COSObjectApi class

Inheritance

Constructors

COSObjectApi(COSConfig config, {required String bucketName, required String region})

Properties

bucketName String
存储桶,COS 中用于存储数据的容器
finalinherited
client COSClient
no setterinherited
config COSConfig
COS 配置
finalinherited
hashCode int
The hash code for this object.
no setterinherited
region String
地域信息,枚举值可参见 可用地域 文档,例如:ap-beijing、ap-hongkong、eu-frankfurt 等
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

deleteDirectory({String? bucketName, String? region, required String directory}) Future<bool>
删除目录 bucketName region directory
inherited
deleteMultipleObjects({String? bucketName, String? region, required COSDelete delete}) Future<COSDeleteResult>
DELETE Multiple Objects 接口请求可以批量删除指定存储桶中的多个对象(Object),单次请求支持最多删除1000个对象 bucketName region delete
inherited
deleteObject({String? bucketName, String? region, required String objectKey, String? versionId}) Future<Response>
DELETE Object 接口请求可以删除一个指定的对象(Object) bucketName region objectKey versionId
inherited
deleteObjectTagging({String? bucketName, String? region, required String objectKey, String? versionId}) Future<Response>
DELETE Object tagging 接口用于删除指定对象下已有的对象标签。 bucketName region objectKey versionId
inherited
getBaseApiUrl([String? bucketName, String? region]) String
拼接BaseApiUrl bucketName 存储桶 region 区域信息
inherited
getObject({String? bucketName, String? region, required String objectKey, COSGetObjectQuery? getObjectQuery, Map<String, String> headers = const <String, String>{}}) Future<Response>
GET Object GET Object 接口请求可以将 COS 存储桶中的对象(Object)下载至本地 bucketName region objectKey getObjectQuery headers
inherited
getObjectACL({String? bucketName, String? region, required String objectKey}) Future<COSAccessControlPolicy>
GET Object acl 接口用来获取对象的访问控制列表(ACL)。该 API 的请求者需要对指定对象有读取 ACL 权限。 bucketName region objectKey
inherited
getObjectTagging({String? bucketName, String? region, required String objectKey, String? versionId}) Future<COSTagging>
GET Object tagging 接口用于查询指定对象下已有的对象标签。 bucketName region objectKey versionId
inherited
headObject({String? bucketName, String? region, required String objectKey, String? versionId, Map<String, String> headers = const <String, String>{}}) Future<Response>
POST Object 接口请求可以将本地不超过5GB的对象(Object)以网页表单(HTML Form)的形式上传至指定存储桶中 HEAD Object 接口请求可以判断指定对象是否存在和有权限,并在指定对象可访问时获取其元数据 bucketName region objectKey versionId headers
inherited
listObjects({String? bucketName, String? region, COSListObjectHeader? listObjectHeader}) Future<COSListBucketResult>
GET Bucket 请求等同于 List Objects 请求,可以列出该存储桶内的部分或者全部对象。 bucketName region listObjectHeader
inherited
listObjectVersions({String? bucketName, String? region, COSListObjectHeader? listObjectHeader}) Future<COSListVersionsResult>
GET Bucket Object versions 接口用于拉取存储桶内的所有对象及其历史版本信息, 您可以通过指定参数筛选出存储桶内部分对象及其历史版本信息 bucketName region listObjectHeader
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
optionsObject({String? bucketName, String? region, required String objectKey, required String origin, required String accessControlRequestMethod, String? accessControlRequestHeaders}) Future<Response>
OPTIONS Object 用于跨域资源共享(CORS)的预检(Preflight)请求 bucketName region objectKey origin accessControlRequestMethod accessControlRequestHeaders
inherited
postObjectRestore({String? bucketName, String? region, required String objectKey, required COSRestoreRequest restoreRequest}) Future<Response>
POST Object restore 接口请求可以对一个归档存储或深度归档存储类型的对象进行恢复(解冻) 以便读取该对象内容,恢复出的可读取对象是临时的,您可以设置需要保持可读以及随后删除该临时副本的时间 bucketName region objectKey restoreRequest
inherited
putDirectory({String? bucketName, String? region, required String directory, Map<String, String> headers = const <String, String>{}}) Future<bool>
上传目录 bucketName region directory headers
putFileObject({String? bucketName, String? region, required String objectKey, required String filePath, COSACLHeader? aclHeader, Map<String, String> headers = const <String, String>{}}) Future<Response>
上传文件对象 bucketName region objectKey filePath headers
putFolderObject({String? bucketName, String? region, required String objectKey, COSACLHeader? aclHeader, Map<String, String> headers = const <String, String>{}}) Future<Response>
上传文件夹对象 bucketName region objectKey headers
inherited
putObject({String? bucketName, String? region, required String objectKey, List<int>? objectValue, String? contentType, COSACLHeader? aclHeader, Map<String, String> headers = const <String, String>{}}) Future<Response>
PUT Object 接口请求可以将本地的对象(Object)上传至指定存储桶中 bucketName region objectKey objectValue contentType headers
inherited
putObjectACL({String? bucketName, String? region, required String objectKey, COSACLHeader? aclHeader, COSAccessControlPolicy? accessControlPolicy}) Future<Response>
PUT Object acl 接口用来写入对象的访问控制列表(ACL), 您可以通过请求头x-cos-acl和x-cos-grant-*传入 ACL 信息,或者通过请求体以 XML 格式传入 ACL 信息。 bucketName region objectKey aclHeader accessControlPolicy
inherited
putObjectCopy({String? bucketName, String? region, required String objectKey, required String xCOSCopySource, required String contentType, COSACLHeader? aclHeader, Map<String, String> headers = const <String, String>{}}) Future<COSCopyObjectResult>
PUT Object - Copy 接口请求创建一个已存在 COS 的对象的副本,即将一个对象从源路径(对象键)复制到目标路径(对象键) bucketName region objectKey xCOSCopySource contentType headers
inherited
putObjectTagging({String? bucketName, String? region, required String objectKey, required COSTagging tagging, String? versionId}) Future<Response>
COS 支持为已存在的对象设置标签。PUT Object tagging 接口通过为对象添加键值对作为对象标签,可以协助您分组管理已有的对象资源 bucketName region objectKey tagging versionId
inherited
toString() String
A string representation of this object.
inherited
toValidation(Response response) → Response
验证 response 是否有效 response http response
inherited
toXml<T>(Response response) XmlConverterResult<T>
将 response 转化成 xml response http response
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited