C# Class QCloud.CosApi.Api.CosCloud

Datei anzeigen Open project: tencentyun/cos-dotnet-sdk Class Usage Examples

Public Methods

Method Description
CosCloud ( int appId, string secretId, string secretKey, int timeOut = HTTP_TIMEOUT_TIME ) : System

CosCloud 构造方法

CreateFolder ( string bucketName, string remotePath, string>.Dictionary parameterDic = null ) : string

创建文件夹

DeleteFile ( string bucketName, string remotePath ) : string

删除文件

DeleteFolder ( string bucketName, string remotePath ) : string

删除文件夹

GetFileStat ( string bucketName, string remotePath ) : string

获取文件信息

GetFolderList ( string bucketName, string remotePath, string>.Dictionary parameterDic ) : string

目录列表,前缀搜索

GetFolderStat ( string bucketName, string remotePath ) : string

获取文件夹信息

MoveFile ( string bucketName, string srcPath, string dstPath, int toOverWrite ) : string

移动(重命名)文件

UpdateFile ( string bucketName, string remotePath, string>.Dictionary parameterDic = null ) : string

更新文件信息

UpdateFolder ( string bucketName, string remotePath, string>.Dictionary parameterDic = null ) : string

更新文件夹信息

UploadFile ( string bucketName, string remotePath, string localPath, string>.Dictionary parameterDic = null ) : string

文件上传 说明: 根据文件大小判断使用单文件上传还是分片上传,当文件大于20M时,内部会进行分片上传,可以携带分片大小sliceSize

Private Methods

Method Description
SliceUploadFile ( string bucketName, string remotePath, string localPath, string bizAttribute = "", int sliceSize = SLICE_SIZE.SLIZE_SIZE_1M, int insertOnly = 1 ) : string

分片上传

SliceUploadFileFirstStep ( string bucketName, string remotePath, string localPath, int sliceSize, string biz_attr = "", int insertOnly = 1 ) : string

分片上传第一步

SliceUploadFileFollowStep ( string bucketName, string remotePath, string localPath, string sessionId, long offset, int sliceSize ) : string

分片上传后续步骤

Upload ( string bucketName, string remotePath, string localPath, string bizAttribute = "", int insertOnly = 1 ) : string

单个文件上传

addAuthority ( object>.Dictionary &data, string>.Dictionary &paras ) : bool

内部方法:增加参数authority到data中

addCustomerHeaders ( object>.Dictionary &data, string>.Dictionary &paras ) : bool

内部方法:增加用户自定义参数到data中

addFolderListNum ( object>.Dictionary &data, string>.Dictionary &paras ) : bool

内部方法:增加参数num到data中

addInsertOnly ( object>.Dictionary &data, string>.Dictionary &paras ) : bool

内部方法:增加参数insertOnly到data中

addOrder ( object>.Dictionary &data, string>.Dictionary &paras ) : bool

内部方法:增加参数order到data中

addParameter ( string paraName, object>.Dictionary &data, string>.Dictionary &paras ) : bool

内部方法:增加参数到data中

addPattern ( object>.Dictionary &data, string>.Dictionary &paras ) : bool

内部方法:增加参数Pattern到data中

checkPathValid ( string url ) : bool

内部方法:检测文件夹名字的合法性 保留符号(英文半角符号)不可以使用。例如:'/' , '?' , '*' , ':' , '|' , '\' , '<' , '>' , '"'

constructResult ( int code, string message ) : string

内部方法:构造结果响应

generateURL ( string bucketName, string remotePath ) : string

内部方法:构造URL

generateURL ( string bucketName, string remotePath, string prefix ) : string

内部方法:构造URL

getExpiredTime ( ) : long

内部方法:超时时间(当前系统时间+300秒)

getSliceSize ( int sliceSize ) : int

内部方法:用户传入的slice_size进行规范

isAuthorityValid ( string authority ) : bool

内部方法:判断参数authority参数值是否合法

isCustomerHeader ( string key ) : bool

内部方法:判断是否为用户自定义参数

setCustomerHeaders ( object>.Dictionary &data, string>.Dictionary &parameterDic ) : bool

内部方法:增加用户自定义参数到data中

Method Details

CosCloud() public method

CosCloud 构造方法
public CosCloud ( int appId, string secretId, string secretKey, int timeOut = HTTP_TIMEOUT_TIME ) : System
appId int 授权appid
secretId string 授权secret id
secretKey string 授权secret key
timeOut int 网络超时,默认60秒
return System

CreateFolder() public method

创建文件夹
public CreateFolder ( string bucketName, string remotePath, string>.Dictionary parameterDic = null ) : string
bucketName string bucket名称
remotePath string 远程文件夹路径
parameterDic string>.Dictionary 参数Dictionary
return string

DeleteFile() public method

删除文件
public DeleteFile ( string bucketName, string remotePath ) : string
bucketName string bucket名称
remotePath string 远程文件路径
return string

DeleteFolder() public method

删除文件夹
public DeleteFolder ( string bucketName, string remotePath ) : string
bucketName string bucket名称
remotePath string 远程文件夹路径
return string

GetFileStat() public method

获取文件信息
public GetFileStat ( string bucketName, string remotePath ) : string
bucketName string bucket名称
remotePath string 远程文件路径
return string

GetFolderList() public method

目录列表,前缀搜索
public GetFolderList ( string bucketName, string remotePath, string>.Dictionary parameterDic ) : string
bucketName string bucket名称
remotePath string 远程文件夹路径
parameterDic string>.Dictionary 参数Dictionary
return string

GetFolderStat() public method

获取文件夹信息
public GetFolderStat ( string bucketName, string remotePath ) : string
bucketName string bucket名称
remotePath string 远程文件夹路径
return string

MoveFile() public method

移动(重命名)文件
public MoveFile ( string bucketName, string srcPath, string dstPath, int toOverWrite ) : string
bucketName string bucket名称
srcPath string 源文件路径
dstPath string 目标文件路径
toOverWrite int 是否覆盖写
return string

UpdateFile() public method

更新文件信息
public UpdateFile ( string bucketName, string remotePath, string>.Dictionary parameterDic = null ) : string
bucketName string bucket名称
remotePath string 远程文件路径
parameterDic string>.Dictionary 参数Dictionary
return string

UpdateFolder() public method

更新文件夹信息
public UpdateFolder ( string bucketName, string remotePath, string>.Dictionary parameterDic = null ) : string
bucketName string bucket名称
remotePath string 远程文件夹路径
parameterDic string>.Dictionary 可选参数Dictionary
return string

UploadFile() public method

文件上传 说明: 根据文件大小判断使用单文件上传还是分片上传,当文件大于20M时,内部会进行分片上传,可以携带分片大小sliceSize
public UploadFile ( string bucketName, string remotePath, string localPath, string>.Dictionary parameterDic = null ) : string
bucketName string bucket名称
remotePath string 远程文件路径
localPath string 本地文件路径
parameterDic string>.Dictionary 参数Dictionary
return string