.NET SDK

<p class="shortdesc"></p> <section class="section" id="NET_SDK___section_mdv_m4m_qlb"><h2 class="doc-tairway">简介</h2> <p class="p">.NET SDK便于.NET平台开发者快速对接使用OBS对象存储服务。在使用之前,您需要确保已经是平安云用户,并且开通了OBS服务。如果您还没有开通或者还不了解平安云 OBS 服务,请登录 <a class="xref" href="/ssr/products/OBS" target="_blank">OBS产品主页 </a>进行了解。</p> </section> <section class="section" id="NET_SDK___section_qkp_n4m_qlb"><h2 class="doc-tairway"> SDK下载</h2> <p class="p">.NET SDK 开发包最新版本<a class="xref" href="https://obs-cn-shanghai.yun.pingan.com/pcp-portal/sdk%2Fobs-.NET-sdk-1.0.0.zip?response-content-disposition=attachment%3Bfilename%3Dobs-.NET-sdk-1.0.0.zip" target="_blank"> v1.0.0</a></p> </section> <section class="section" id="NET_SDK___section_ywp_n4m_qlb"><h2 class="doc-tairway">API概览</h2> <table class="table" id="NET_SDK___table_fvr_s4m_qlb"><caption></caption><colgroup><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="NET_SDK___table_fvr_s4m_qlb__entry__1"><p class="p">API</p></th> <th class="entry" id="NET_SDK___table_fvr_s4m_qlb__entry__2"><p class="p">描述</p></th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="NET_SDK___table_fvr_s4m_qlb__entry__1 "><p class="p">PutObject</p></td> <td class="entry" headers="NET_SDK___table_fvr_s4m_qlb__entry__2 "> <p class="p">OBS .NET SDK 提供了多种文件上传接口,可以通过以下方式上传文件:</p> <ul class="ul" id="NET_SDK___ul_gvr_s4m_qlb"> <li class="li">文件上传</li> <li class="li">流式上传</li> </ul></td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_fvr_s4m_qlb__entry__1 "><p class="p">GetObject</p></td> <td class="entry" headers="NET_SDK___table_fvr_s4m_qlb__entry__2 "><p class="p">文件下载</p></td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_fvr_s4m_qlb__entry__1 "><p class="p">GetDownloadUrl</p></td> <td class="entry" headers="NET_SDK___table_fvr_s4m_qlb__entry__2 "><p class="p">获取下载链接</p></td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_fvr_s4m_qlb__entry__1 "><p class="p">DeleteObject</p></td> <td class="entry" headers="NET_SDK___table_fvr_s4m_qlb__entry__2 "><p class="p">删除文件</p></td> </tr> </tbody></table> </section> <section class="section" id="NET_SDK___section_ixq_44m_qlb"><h2 class="doc-tairway">API描述</h2> <p class="p"><strong class="ph b">(1)初始化</strong></p> <p class="p"><strong class="ph b">接口描述</strong></p> <p class="p">初始化调用OBS服务的对象ObsService,提供三个入参的构造方法。ObsService提供上传、下载、上传文件基本操作。</p> <p class="p">您需要接入平安云OBS服务,拥有有效的accessKey、secretKey进行签名认证。</p> <p class="p"><strong class="ph b">请求参数</strong></p> <table class="table" id="NET_SDK___table_r2p_54m_qlb"><caption></caption><colgroup><col><col><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="NET_SDK___table_r2p_54m_qlb__entry__1"><p class="p">参数名称</p></th> <th class="entry" id="NET_SDK___table_r2p_54m_qlb__entry__2"><p class="p">参数类型</p></th> <th class="entry" id="NET_SDK___table_r2p_54m_qlb__entry__3"><p class="p">是否必须</p></th> <th class="entry" id="NET_SDK___table_r2p_54m_qlb__entry__4"><p class="p">参数描述</p></th> <th class="entry" id="NET_SDK___table_r2p_54m_qlb__entry__5"><p class="p">备注</p></th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__1 "><p class="p">endpoint</p></td> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__4 "><p class="p">OBS区域访问地址</p></td> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__1 "><p class="p">accessKey</p></td> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__4 "><p class="p">OBS租户访问的ak</p></td> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__1 "><p class="p">secretKey</p></td> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__4 "><p class="p">OBS租户访问秘钥</p></td> <td class="entry" headers="NET_SDK___table_r2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">响应参数</strong></p> <table class="table" id="NET_SDK___table_s2p_54m_qlb"><caption></caption><colgroup><col><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="NET_SDK___table_s2p_54m_qlb__entry__1"><p class="p">参数名称</p></th> <th class="entry" id="NET_SDK___table_s2p_54m_qlb__entry__2"><p class="p">参数类型</p></th> <th class="entry" id="NET_SDK___table_s2p_54m_qlb__entry__3"><p class="p">参数描述</p></th> <th class="entry" id="NET_SDK___table_s2p_54m_qlb__entry__4"><p class="p">备注</p></th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="NET_SDK___table_s2p_54m_qlb__entry__1 "><p class="p">ObsService</p></td> <td class="entry" headers="NET_SDK___table_s2p_54m_qlb__entry__2 "><p class="p">var</p></td> <td class="entry" headers="NET_SDK___table_s2p_54m_qlb__entry__3 "><p class="p">实例化对象</p></td> <td class="entry" headers="NET_SDK___table_s2p_54m_qlb__entry__4 "> <p class="p">-</p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">实例</strong></p> <pre class="pre codeblock"><code>var obsService = new ObsService("your endpoint", "your accessKey", "your secretKey");</code></pre> <p class="p"><strong class="ph b">(2)PutObject</strong></p> <p class="p"><strong class="ph b">接口描述</strong></p> <p class="p">文件上传</p> <pre xmlns:version="java:net.sf.saxon.Version" class="pre codeblock language-java">PutObjectResponse PutObject(String BucketName, String ObjectKey, String FilePath) PutObjectResponse PutObject(String BucketName, String ObjectKey, String FilePath, MetadataCollection Metadata)</pre> <p class="p"><strong class="ph b">请求参数</strong></p> <table class="table" id="NET_SDK___table_t2p_54m_qlb"><caption></caption><colgroup><col><col><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="NET_SDK___table_t2p_54m_qlb__entry__1"><p class="p">参数名称</p></th> <th class="entry" id="NET_SDK___table_t2p_54m_qlb__entry__2"><p class="p">参数类型</p></th> <th class="entry" id="NET_SDK___table_t2p_54m_qlb__entry__3"><p class="p">是否必须</p></th> <th class="entry" id="NET_SDK___table_t2p_54m_qlb__entry__4"><p class="p">参数描述</p></th> <th class="entry" id="NET_SDK___table_t2p_54m_qlb__entry__5"><p class="p">备注</p></th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__1 "><p class="p">bucketName</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__4 "><p class="p">保存对象的 bucket 名称</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__1 "><p class="p">objectKey</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__4 "><p class="p">对象Key,需自行实现策略保证同一bucket下objectKey唯一,不能为空,首字符不能为路径符</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__1 "><p class="p">filePath</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__4 "><p class="p">上传文件的路径</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__1 "><p class="p">metadata</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__2 "><p class="p">MetadataCollection</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__3 "><p class="p">false</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__4 "><p class="p">对象元信息</p></td> <td class="entry" headers="NET_SDK___table_t2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">响应参数</strong></p> <table class="table" id="NET_SDK___table_u2p_54m_qlb"><caption></caption><colgroup><col><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="NET_SDK___table_u2p_54m_qlb__entry__1"><p class="p">参数名称</p></th> <th class="entry" id="NET_SDK___table_u2p_54m_qlb__entry__2"><p class="p">参数类型</p></th> <th class="entry" id="NET_SDK___table_u2p_54m_qlb__entry__3"><p class="p">参数描述</p></th> <th class="entry" id="NET_SDK___table_u2p_54m_qlb__entry__4"><p class="p">备注</p></th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="NET_SDK___table_u2p_54m_qlb__entry__1 "><p class="p">putObjectResult</p></td> <td class="entry" headers="NET_SDK___table_u2p_54m_qlb__entry__2 "><p class="p">PutObjectResult</p></td> <td class="entry" headers="NET_SDK___table_u2p_54m_qlb__entry__3 "><p class="p">PutObjectResult返回对象</p></td> <td class="entry" headers="NET_SDK___table_u2p_54m_qlb__entry__4 "> <p class="p">-</p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">实例</strong></p> <pre xmlns:version="java:net.sf.saxon.Version" class="pre codeblock language-java"><em class="hl-comment" style="color:#006400">/*标准文件上传*/</em> var putObjectResult = obsService.PutObject(BucketName,ObjectKey,FilePath); <em class="hl-comment" style="color:#006400">/*附带文件原信息上传*/</em> var metaData = <strong class="hl-keyword" style="color:#7f0055">new</strong> MetadataCollection(); metaData.Add(<span class="hl-string" style="color:#2a00ff">"file_name"</span>,<span class="hl-string" style="color:#2a00ff">"test.jpg"</span>); var putObjectResult = obsService.PutObject PutObject(BucketName, ObjectKey, FilePath, metaData);</pre> <p class="p"><strong class="ph b">(3) PutObject</strong></p> <p class="p"><strong class="ph b">接口描述</strong></p> <p class="p">流式上传</p> <pre xmlns:version="java:net.sf.saxon.Version" class="pre codeblock language-java">PutObjectResponse PutObject(String BucketName, String ObjectKey, Stream InputStream) PutObjectResponse PutObject(String BucketName, String ObjectKey, Stream InputStream, MetadataCollection Metadata)</pre> <p class="p"><strong class="ph b">请求参数</strong></p> <table class="table" id="NET_SDK___table_v2p_54m_qlb"><caption></caption><colgroup><col><col><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="NET_SDK___table_v2p_54m_qlb__entry__1"><p class="p">参数名称</p></th> <th class="entry" id="NET_SDK___table_v2p_54m_qlb__entry__2"><p class="p">参数类型</p></th> <th class="entry" id="NET_SDK___table_v2p_54m_qlb__entry__3"><p class="p">是否必须</p></th> <th class="entry" id="NET_SDK___table_v2p_54m_qlb__entry__4"><p class="p">参数描述</p></th> <th class="entry" id="NET_SDK___table_v2p_54m_qlb__entry__5"><p class="p">备注</p></th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__1 "><p class="p">bucketName</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__4 "><p class="p">保存对象的 bucket 名称</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__1 "><p class="p">objectKey</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__4 "><p class="p">对象Key,需自行实现策略保证同一bucket下objectKey唯一,不能为空,首字符不能为路径符</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__1 "><p class="p">inputStream</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__2 "><p class="p">Stream</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__4 "><p class="p">输入流</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__1 "><p class="p">metadata</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__2 "><p class="p">MetadataCollection</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__3 "><p class="p">false</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__4 "><p class="p">对象元信息</p></td> <td class="entry" headers="NET_SDK___table_v2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">响应参数</strong></p> <table class="table" id="NET_SDK___table_w2p_54m_qlb"><caption></caption><colgroup><col><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="NET_SDK___table_w2p_54m_qlb__entry__1"><p class="p">参数名称</p></th> <th class="entry" id="NET_SDK___table_w2p_54m_qlb__entry__2"><p class="p">参数类型</p></th> <th class="entry" id="NET_SDK___table_w2p_54m_qlb__entry__3"><p class="p">参数描述</p></th> <th class="entry" id="NET_SDK___table_w2p_54m_qlb__entry__4"><p class="p">备注</p></th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="NET_SDK___table_w2p_54m_qlb__entry__1 "><p class="p">putObjectResult</p></td> <td class="entry" headers="NET_SDK___table_w2p_54m_qlb__entry__2 "><p class="p">PutObjectResult</p></td> <td class="entry" headers="NET_SDK___table_w2p_54m_qlb__entry__3 "><p class="p">PutObjectResult返回对象</p></td> <td class="entry" headers="NET_SDK___table_w2p_54m_qlb__entry__4 "> <p class="p">-</p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">实例</strong></p> <pre xmlns:version="java:net.sf.saxon.Version" class="pre codeblock language-java"><em class="hl-comment" style="color:#006400">/*标准流上传*/</em> var putObjectResult = obsService.PutObject(BucketName,ObjectKey,InputStream); <em class="hl-comment" style="color:#006400">/*附带流原信息上传*/</em> var metaData = <strong class="hl-keyword" style="color:#7f0055">new</strong> MetadataCollection(); metaData.Add(<span class="hl-string" style="color:#2a00ff">"file_name"</span>,<span class="hl-string" style="color:#2a00ff">"test.jpg"</span>); var putObjectResult = obsService.PutObject PutObject(BucketName, ObjectKey, InputStream, metaData);</pre> <p class="p"><strong class="ph b">(4) GetObject</strong></p> <p class="p"><strong class="ph b">接口描述</strong></p> <p class="p">文件下载</p> <pre xmlns:version="java:net.sf.saxon.Version" class="pre codeblock language-java">GetObjectResponse GetObject (String BucketName, String ObjectKey)</pre> <p class="p"><strong class="ph b">请求参数</strong></p> <table class="table" id="NET_SDK___table_x2p_54m_qlb"><caption></caption><colgroup><col><col><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="NET_SDK___table_x2p_54m_qlb__entry__1"><p class="p">参数名称</p></th> <th class="entry" id="NET_SDK___table_x2p_54m_qlb__entry__2"><p class="p">参数类型</p></th> <th class="entry" id="NET_SDK___table_x2p_54m_qlb__entry__3"><p class="p">是否必须</p></th> <th class="entry" id="NET_SDK___table_x2p_54m_qlb__entry__4"><p class="p">参数描述</p></th> <th class="entry" id="NET_SDK___table_x2p_54m_qlb__entry__5"><p class="p">备注</p></th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="NET_SDK___table_x2p_54m_qlb__entry__1 "><p class="p">bucketName</p></td> <td class="entry" headers="NET_SDK___table_x2p_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_x2p_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_x2p_54m_qlb__entry__4 "><p class="p">保存对象的 bucket 名称</p></td> <td class="entry" headers="NET_SDK___table_x2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_x2p_54m_qlb__entry__1 "><p class="p">objectKey</p></td> <td class="entry" headers="NET_SDK___table_x2p_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_x2p_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_x2p_54m_qlb__entry__4 "><p class="p">对象Key,需自行实现策略保证同一bucket下objectKey唯一,不能为空,首字符不能为路径符</p></td> <td class="entry" headers="NET_SDK___table_x2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">响应参数</strong></p> <table class="table" id="NET_SDK___table_y2p_54m_qlb"><caption></caption><colgroup><col><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="NET_SDK___table_y2p_54m_qlb__entry__1"><p class="p">参数名称</p></th> <th class="entry" id="NET_SDK___table_y2p_54m_qlb__entry__2"><p class="p">参数类型</p></th> <th class="entry" id="NET_SDK___table_y2p_54m_qlb__entry__3"><p class="p">参数描述</p></th> <th class="entry" id="NET_SDK___table_y2p_54m_qlb__entry__4"><p class="p">备注</p></th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="NET_SDK___table_y2p_54m_qlb__entry__1 "><p class="p">getObjectResponse</p></td> <td class="entry" headers="NET_SDK___table_y2p_54m_qlb__entry__2 "><p class="p">GetObjectResponse</p></td> <td class="entry" headers="NET_SDK___table_y2p_54m_qlb__entry__3 "><p class="p">GetObjectResponse对象</p></td> <td class="entry" headers="NET_SDK___table_y2p_54m_qlb__entry__4 "> <p class="p">-</p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">实例</strong></p> <pre xmlns:version="java:net.sf.saxon.Version" class="pre codeblock language-java">var getObjectResp = os.GetObject(bucketName, keyName);</pre> <p class="p"><strong class="ph b">(5) GetDownloadUrl</strong></p> <p class="p"><strong class="ph b">接口描述</strong></p> <p class="p">获取下载链接。</p> <pre xmlns:version="java:net.sf.saxon.Version" class="pre codeblock language-java">String GetDownloadUrl(String BucketName, String ObjectKey) String GetDownloadUrl(String BucketName, String ObjectKey, String displayFileName) String GetDownloadUrl(String BucketName, String ObjectKey, String displayFileName, <strong class="hl-keyword" style="color:#7f0055">long</strong> expiresSeconds)</pre> <p class="p"><strong class="ph b">请求参数</strong></p> <table class="table" id="NET_SDK___table_z2p_54m_qlb"><caption></caption><colgroup><col><col><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="NET_SDK___table_z2p_54m_qlb__entry__1"><p class="p">参数名称</p></th> <th class="entry" id="NET_SDK___table_z2p_54m_qlb__entry__2"><p class="p">参数类型</p></th> <th class="entry" id="NET_SDK___table_z2p_54m_qlb__entry__3"><p class="p">是否必须</p></th> <th class="entry" id="NET_SDK___table_z2p_54m_qlb__entry__4"><p class="p">参数描述</p></th> <th class="entry" id="NET_SDK___table_z2p_54m_qlb__entry__5"><p class="p">备注</p></th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__1 "><p class="p">bucketName</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__4 "><p class="p">保存对象的 bucket 名称</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__1 "><p class="p">objectKey</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__4 "><p class="p">对象Key</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__1 "><p class="p">displayFileName</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__3 "><p class="p">false</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__4 "><p class="p">在请求url时,期望云存储服务端返回的content-disposition头信息,默认为null</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__1 "><p class="p">expireSeconds</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__2 "><p class="p">long</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__3 "><p class="p">false</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__4 "><p class="p">url有效秒数,url生成后,在此时间段内有效,过期的url会被云存储拒绝访问,默认为20s</p></td> <td class="entry" headers="NET_SDK___table_z2p_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">响应参数</strong></p> <table class="table" id="NET_SDK___table_afp_54m_qlb"><caption></caption><colgroup><col><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="NET_SDK___table_afp_54m_qlb__entry__1"><p class="p">参数名称</p></th> <th class="entry" id="NET_SDK___table_afp_54m_qlb__entry__2"><p class="p">参数类型</p></th> <th class="entry" id="NET_SDK___table_afp_54m_qlb__entry__3"><p class="p">参数描述</p></th> <th class="entry" id="NET_SDK___table_afp_54m_qlb__entry__4"><p class="p">备注</p></th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="NET_SDK___table_afp_54m_qlb__entry__1 "><p class="p">url</p></td> <td class="entry" headers="NET_SDK___table_afp_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_afp_54m_qlb__entry__3 "><p class="p">已签名的文件下载链接</p></td> <td class="entry" headers="NET_SDK___table_afp_54m_qlb__entry__4 "> <p class="p">-</p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">(6) DeleteObject</strong></p> <p class="p"><strong class="ph b">接口描述</strong></p> <p class="p">删除文件</p> <pre xmlns:version="java:net.sf.saxon.Version" class="pre codeblock language-java">DeleteObjectResponse DeleteObject(String BucketName, String ObjectKey)</pre> <p class="p"><strong class="ph b">请求参数</strong></p> <table class="table" id="NET_SDK___table_bfp_54m_qlb"><caption></caption><colgroup><col><col><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="NET_SDK___table_bfp_54m_qlb__entry__1"><p class="p">参数名称</p></th> <th class="entry" id="NET_SDK___table_bfp_54m_qlb__entry__2"><p class="p">参数类型</p></th> <th class="entry" id="NET_SDK___table_bfp_54m_qlb__entry__3"><p class="p">是否必须</p></th> <th class="entry" id="NET_SDK___table_bfp_54m_qlb__entry__4"><p class="p">参数描述</p></th> <th class="entry" id="NET_SDK___table_bfp_54m_qlb__entry__5"><p class="p">备注</p></th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="NET_SDK___table_bfp_54m_qlb__entry__1 "><p class="p">bucketName</p></td> <td class="entry" headers="NET_SDK___table_bfp_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_bfp_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_bfp_54m_qlb__entry__4 "><p class="p">保存对象的 bucket 名称</p></td> <td class="entry" headers="NET_SDK___table_bfp_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> <tr class="row"> <td class="entry" headers="NET_SDK___table_bfp_54m_qlb__entry__1 "><p class="p">objectKey</p></td> <td class="entry" headers="NET_SDK___table_bfp_54m_qlb__entry__2 "><p class="p">String</p></td> <td class="entry" headers="NET_SDK___table_bfp_54m_qlb__entry__3 "><p class="p">true</p></td> <td class="entry" headers="NET_SDK___table_bfp_54m_qlb__entry__4 "><p class="p">对象Key</p></td> <td class="entry" headers="NET_SDK___table_bfp_54m_qlb__entry__5 "> <p class="p">-</p> </td> </tr> </tbody></table> <p class="p"><strong class="ph b">响应参数</strong></p> <table class="table" id="NET_SDK___table_cfp_54m_qlb"><caption></caption><colgroup><col><col><col><col></colgroup><thead class="thead"> <tr class="row"> <th class="entry" id="NET_SDK___table_cfp_54m_qlb__entry__1"><p class="p">参数名称</p></th> <th class="entry" id="NET_SDK___table_cfp_54m_qlb__entry__2"><p class="p">参数类型</p></th> <th class="entry" id="NET_SDK___table_cfp_54m_qlb__entry__3"><p class="p">参数描述</p></th> <th class="entry" id="NET_SDK___table_cfp_54m_qlb__entry__4"><p class="p">备注</p></th> </tr> </thead><tbody class="tbody"> <tr class="row"> <td class="entry" headers="NET_SDK___table_cfp_54m_qlb__entry__1 "><p class="p">deleteObjectResponse</p></td> <td class="entry" headers="NET_SDK___table_cfp_54m_qlb__entry__2 "><p class="p">DeleteObjectResponse</p></td> <td class="entry" headers="NET_SDK___table_cfp_54m_qlb__entry__3 "><p class="p">DeleteObjectResponse对象</p></td> <td class="entry" headers="NET_SDK___table_cfp_54m_qlb__entry__4 "> <p class="p">-</p> </td> </tr> </tbody></table> </section>
Did the above content solve your problem? Yes No
Please complete information!

Call us

400-151-8800

Email us

cloud@pingan.com

Online customer service

Instant reply

Technical Support

cloud products