网友的相关建议:
生成签名以后的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.generatepresigned;
system.out.println(url.tostring());
这段代码假定指定bucketname和key的object已经上传到oss,用户可以根据修改设定expires,即过期时间。更详细的操作可以参考ossclient#generatepresignedurl方法和generatepresignedurlrequest类的帮助。