|
|
@@ -72,12 +72,17 @@ public class ObjectBasicService {
|
|
|
return objectMetadata;
|
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
+ public static void main(String[] args) throws NoSuchAlgorithmException {
|
|
|
String endpoint = "http://oss.reghao.cn";
|
|
|
String bucketName = "tnb";
|
|
|
ObjectBasicService objectBasicService = new ObjectBasicService(endpoint, bucketName);
|
|
|
|
|
|
- String key = "";
|
|
|
- boolean exist = objectBasicService.objectExist(key);
|
|
|
+ /*String key = "";
|
|
|
+ boolean exist = objectBasicService.objectExist(key);*/
|
|
|
+
|
|
|
+ String filePath = "/home/reghao/Downloads/1445972277.jpg";
|
|
|
+ File file = new File(filePath);
|
|
|
+ String key = String.format("a/b/c/d/%s", file.getName());
|
|
|
+ objectBasicService.putObject(key, file);
|
|
|
}
|
|
|
}
|