网友的相关建议:
生成签名以后的URL的示例代码如下:
// Generate a presigned URL
Date expires = new Date (new Date().getTime() + 1000 * 60); // 1 minute to expire
GeneratePresignedUrlRequest generatePresignedUrlRequest =
new GeneratePresignedUrlRequest(bucketName, key);
generatePresignedUrlRequest.setExpiration(expires);
URL url = client.generatePresignedUrl(generatePresignedUrlRequest);
System.out.println(url.toString());
这段代码假定指定bucketName和key的Object已经上传到OSS,用户可以根据修改设定expires,即过期时间。更详细的操作可以参考OSSClient#generatePresignedUrl方法和GeneratePresignedUrlRequest类的帮助。