forked from qiniu/java-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34bb968
commit c936d9b
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
import com.qiniu.common.QiniuException; | ||
import com.qiniu.common.Zone; | ||
import com.qiniu.http.Response; | ||
import com.qiniu.util.Auth; | ||
|
||
public class DomainListDemo { | ||
public static void main(String args[]) { | ||
//设置需要操作的账号的AK和SK | ||
String ACCESS_KEY = "DWQOcrnPp1ogwgAHBdIK1mI-"; | ||
String SECRET_KEY = "cJFhYuaq7Vo35e1pmXO0aGkJG"; | ||
Auth auth = Auth.create(ACCESS_KEY, SECRET_KEY); | ||
|
||
Zone z = Zone.zone0(); | ||
Configuration c = new Configuration(z); | ||
|
||
//实例化一个BucketManager对象 | ||
BucketManager bucketManager = new BucketManager(auth, c); | ||
|
||
//要列举文件的空间名 | ||
String bucket = "dorst1"; | ||
|
||
try { | ||
String[] domainLists = bucketManager.domainList(bucket); | ||
for(String domain : domainLists) | ||
System.out.print(domain); | ||
|
||
} catch (QiniuException e) { | ||
|
||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters