|
@@ -2,6 +2,7 @@ package com.gis.common.util;
|
|
|
|
|
|
import com.google.gson.Gson;
|
|
|
import com.qiniu.common.QiniuException;
|
|
|
+import com.qiniu.common.Zone;
|
|
|
import com.qiniu.http.Response;
|
|
|
import com.qiniu.storage.BucketManager;
|
|
|
import com.qiniu.storage.Configuration;
|
|
@@ -26,12 +27,17 @@ public class QiniuOssUtil {
|
|
|
private static String ACCESS_KEY = "dlPPwgZky_F-iP8CbSbJpiAtAcqw3BYwb9rdHMrS";
|
|
|
private static String SECRET_KEY = "YEtkLKDsImXB-8m1CT1zV_YwCwwGvrUvo2ktj9KZ";
|
|
|
|
|
|
- // 大场景 super
|
|
|
+ // 大场景 super 华南区域
|
|
|
private static String bucketName = "super";
|
|
|
|
|
|
+
|
|
|
//构造一个带指定 Region 对象的配置类, Region.region2(): 华南区域
|
|
|
private static Configuration cfg = new Configuration(Region.region2());
|
|
|
|
|
|
+ // 华北
|
|
|
+// private static String bucketName = "model3d";
|
|
|
+// private static Configuration cfg = new Configuration(Zone.autoZone());
|
|
|
+
|
|
|
//...其他参数参考类注释
|
|
|
private static UploadManager uploadManager = new UploadManager(cfg);
|
|
|
|
|
@@ -112,8 +118,8 @@ public class QiniuOssUtil {
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) throws QiniuException {
|
|
|
- String localFilePath = "F:\\test\\bigScene\\vision.json";
|
|
|
- String ossFilePath = "data/vision.json";
|
|
|
+ String localFilePath = "F:\\test\\ngin\\11.txt";
|
|
|
+ String ossFilePath = "data/owen/11.txt";
|
|
|
upload(localFilePath, ossFilePath);
|
|
|
|
|
|
// getInfo(ossFilePath);
|