现有第三方授权加密上传后的链接,但安卓端OSS Java SDK 为找到用 第三方授权加密上传链接进行上传的代码,有的话回复一下
import com.aliyun.oss.ClientConfiguration;
import com.aliyun.oss.HttpMethod;
import com.aliyun.oss.OSSClient;
import com.aliyun.oss.common.auth.CredentialsProviderFactory;
import com.aliyun.oss.model.GeneratePresignedUrlRequest;
import com.aliyun.oss.model.ListObjectsRequest;
import com.aliyun.oss.model.OSSObjectSummary;
import com.aliyun.oss.model.ObjectMetadata;
public static void main(String[] args) throws Exception {
String sign = "http://watch-portal.oss-cn-beijing.aliyuncs.com/data/11/1151b7c82780dec9e24ce903047577db.jpg?Expires=1539165607&OSSAccessKeyId=LTAIVjDf6lDyVFcL&Signature=zvV6r3d9pUCiY0QZfWWOKx3qMhs%3D";
String type = "image/jpeg";
OSSClient client = new OSSClient(
"demo",
CredentialsProviderFactory.newDefaultCredentialProvider("demo", "demo"),
new ClientConfiguration());
Map<String, String> headers = new HashMap<String, String>();
//headers.put(com.aliyun.oss.common.utils.HttpHeaders.CONTENT_TYPE, type);
headers.put("Content-Type", type);
client.putObject(new URL(sign), "E:/360截图16540604688794.png", headers, true);
client.shutdown();
}