English | 简体中文
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>oss-baseclient</artifactId>
<version>[1.1.0, 2.0.0)</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>oss-client</artifactId>
<version>[1.1.0, 2.0.0)</version>
</dependency>
Config config = new Config();
// your accessKeyId
config.accessKeyId = "";
// your accessKeySecret
config.accessKeySecret = "";
// signature version
config.signatureVersion = "V2";
Client client = new Client(config);
// putObject
PutObjectRequest request = new PutObjectRequest();
request.bucketName = "sdk-oss-test";
request.objectName = "sdk.txt";
PutObjectRequest.PutObjectRequestHeader header = new PutObjectRequest.PutObjectRequestHeader();
header.storageClass = "Archive";
request.header = header;
request.body = new ByteArrayInputStream("value".getBytes("UTF-8"));
RuntimeObject runtimeObject = new RuntimeObject();
PutObjectResponse response = client.putObject(request, runtimeObject);
// getObject
GetObjectRequest request = new GetObjectRequest();
request.bucketName = "sdk-oss-test";
request.objectName = "123.txt";
RuntimeObject runtimeObject = new RuntimeObject();
GetObjectResponse response = client.getObject(request, runtimeObject);
Opening an Issue, Issues not conforming to the guidelines may be closed immediately.
Detailed changes for each release are documented in the release notes.
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.