fix: 查询桶
This commit is contained in:
@@ -67,13 +67,16 @@ public class AliOssClient implements StandardOssClient {
|
|||||||
return DataSizeUtil.format(x);
|
return DataSizeUtil.format(x);
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String,String> selectAllBucket() {
|
public List<HashMap<String,String>> selectAllBucket() {
|
||||||
List<Bucket> buckets = oss.listBuckets();
|
List<Bucket> buckets = oss.listBuckets();
|
||||||
HashMap<String,String> names = new HashMap<>();
|
List<HashMap<String,String>> list1 = new ArrayList<>();
|
||||||
buckets.forEach(bucket -> {
|
buckets.forEach(bucket -> {
|
||||||
names.put(bucket.getName(),getAliBucketSize(bucket.getName()));
|
HashMap<String, String> names = new HashMap<>();
|
||||||
|
names.put("name",bucket.getName());
|
||||||
|
names.put("size",getAliBucketSize(bucket.getName()));
|
||||||
|
list1.add(names);
|
||||||
});
|
});
|
||||||
return names;
|
return list1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -148,13 +148,16 @@ public class QiNiuOssClient implements StandardOssClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, String> selectAllBucket() throws IOException{
|
public List<HashMap<String, String> >selectAllBucket() throws IOException{
|
||||||
String[] list = bucketManager.buckets();
|
String[] list = bucketManager.buckets();
|
||||||
HashMap<String, String> names = new HashMap<>();
|
List<HashMap<String, String>> list1 = new ArrayList<>();
|
||||||
for(int i=0;i<list.length;i++){
|
for(int i=0;i<list.length;i++){
|
||||||
names.put(list[i],getQiniuBucketSize(list[i]));
|
HashMap<String, String> names = new HashMap<>();
|
||||||
|
names.put("name",list[i]);
|
||||||
|
names.put("size",getQiniuBucketSize(list[i]));
|
||||||
|
list1.add(names);
|
||||||
}
|
}
|
||||||
return names;
|
return list1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -134,13 +134,16 @@ public class TencentOssClient implements StandardOssClient {
|
|||||||
* @author zlg
|
* @author zlg
|
||||||
* @date: 2024/6/29 10:13
|
* @date: 2024/6/29 10:13
|
||||||
*/
|
*/
|
||||||
public HashMap<String, String> selectAllBucket() throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException {
|
public List<HashMap<String, String>> selectAllBucket() throws ServerException, InsufficientDataException, ErrorResponseException, IOException, NoSuchAlgorithmException, InvalidKeyException, InvalidResponseException, XmlParserException, InternalException {
|
||||||
List<Bucket> list = cosClient.listBuckets();
|
List<Bucket> list = cosClient.listBuckets();
|
||||||
HashMap<String, String> names = new HashMap<>();
|
List<HashMap<String, String>> list1 = new ArrayList<>();
|
||||||
list.forEach(bucket -> {
|
list.forEach(bucket -> {
|
||||||
names.put(bucket.getName(), getTencentBucketSize(bucket.getName()));
|
HashMap<String, String> names = new HashMap<>();
|
||||||
|
names.put("name",bucket.getName());
|
||||||
|
names.put("size",getTencentBucketSize(bucket.getName()));
|
||||||
|
list1.add(names);
|
||||||
});
|
});
|
||||||
return names;
|
return list1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTencentBucketSize(String bucket) {
|
public String getTencentBucketSize(String bucket) {
|
||||||
|
Reference in New Issue
Block a user