8
8
import com .qiniu .storage .persistent .FileRecorder ;
9
9
import com .qiniu .util .Auth ;
10
10
import com .zhazhapan .util .Utils ;
11
- import javafx .application .Platform ;
12
11
import org .apache .log4j .Logger ;
13
- import org .code4everything .qiniu .constant .QiniuValueConsts ;
14
- import org .code4everything .qiniu .util .DialogUtils ;
15
- import org .code4everything .qiniu .util .QiniuUtils ;
16
12
17
13
import java .io .IOException ;
18
14
import java .nio .file .Paths ;
24
20
*/
25
21
public class SdkConfigurer {
26
22
23
+ private static final String [] BUCKET_NAME_ARRAY = {"华东" , "华北" , "华南" , "北美" };
24
+
27
25
private static final Map <String , Zone > ZONE = new HashMap <>();
28
26
29
27
private static final Logger LOGGER = Logger .getLogger (SdkConfigurer .class );
@@ -38,10 +36,10 @@ public class SdkConfigurer {
38
36
39
37
static {
40
38
// 加载空间区域
41
- ZONE .put (QiniuValueConsts . BUCKET_NAME_ARRAY [0 ], Zone .zone0 ());
42
- ZONE .put (QiniuValueConsts . BUCKET_NAME_ARRAY [1 ], Zone .zone1 ());
43
- ZONE .put (QiniuValueConsts . BUCKET_NAME_ARRAY [2 ], Zone .zone2 ());
44
- ZONE .put (QiniuValueConsts . BUCKET_NAME_ARRAY [3 ], Zone .zoneNa0 ());
39
+ ZONE .put (BUCKET_NAME_ARRAY [0 ], Zone .zone0 ());
40
+ ZONE .put (BUCKET_NAME_ARRAY [1 ], Zone .zone1 ());
41
+ ZONE .put (BUCKET_NAME_ARRAY [2 ], Zone .zone2 ());
42
+ ZONE .put (BUCKET_NAME_ARRAY [3 ], Zone .zoneNa0 ());
45
43
}
46
44
47
45
private SdkConfigurer () {}
@@ -71,17 +69,9 @@ public static void createAuth(String accessKey, String secretKey) {
71
69
}
72
70
73
71
/**
74
- * 配置文件上传环境
72
+ * 配置文件上传环境,不再做网络检查,请执行保证网络通畅
75
73
*/
76
74
public static boolean configUploadEnv (String zone , String bucket ) {
77
- if (!QiniuUtils .checkNet ()) {
78
- Platform .runLater (() -> {
79
- DialogUtils .showError (QiniuValueConsts .NET_ERROR );
80
- System .exit (0 );
81
- });
82
- return false ;
83
- }
84
- LOGGER .info ("config file upload environment" );
85
75
// 构造一个带指定Zone对象的配置类
86
76
Configuration configuration = new Configuration (SdkConfigurer .ZONE .get (zone ));
87
77
// 生成上传凭证,然后准备上传
0 commit comments