FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java-sdk/examples/CdnRefreshDirsDemo.java at master · CDNCloud-com/java-sdk · GitHub
CDNCloud-com
/
java-sdk
Public
forked from
qiniu/java-sdk
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
java-sdk
/
examples
/
CdnRefreshDirsDemo.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (28 loc) · 1.09 KB
Breadcrumbs
java-sdk
/
examples
/
CdnRefreshDirsDemo.java
Copy path
File metadata and controls
32 lines (28 loc) · 1.09 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package
com
.
qiniu
;
import
com
.
qiniu
.
cdn
.
CdnManager
;
import
com
.
qiniu
.
cdn
.
CdnResult
;
import
com
.
qiniu
.
common
.
QiniuException
;
import
com
.
qiniu
.
util
.
Auth
;
//https://developer.qiniu.com/kodo/sdk/java#fusion-refresh-urls
public
class
CdnRefreshDirsDemo
{
public
static
void
main
(
String
args
[]) {
String
accessKey
=
"your access key"
;
String
secretKey
=
"your secret key"
;
Auth
auth
=
Auth
.
create
(
accessKey
,
secretKey
);
CdnManager
c
=
new
CdnManager
(
auth
);
//待刷新的目录列表,目录必须以 / 结尾
String
[]
dirs
=
new
String
[]{
"http://javasdk.qiniudn.com/gopher1/"
,
"http://javasdk.qiniudn.com/gopher2/"
,
//....
};
try
{
//单次方法调用刷新的目录不可以超过10个,另外刷新目录权限需要联系技术支持开通
CdnResult
.
RefreshResult
result
=
c
.
refreshDirs
(
dirs
);
System
.
out
.
println
(
result
.
code
);
//获取其他的回复内容
}
catch
(
QiniuException
e
) {
System
.
err
.
println
(
e
.
response
.
toString
());
}
}
}
Back
|
FazBrowse Home
|
New Git URL