华为 obs相关

public class HwObsController { @Value("${hw-obs.ak}") private String hwObsAk; @Value("${hw-obs.sk}") private String hwObsSk; @Value("${hw-obs.endPoint}") private String hwObsEndpoint; @Value("${hw-obs.bucketName}") private String hwObsBucketName; @RequestMapping(path = "/getBucketList") public void getBucketList(){ try { logger.info("ak:{}, sk:{}, endpoint:{}, bucketName:{}", hwObsAk, hwObsSk, hwObsEndpoint, hwObsBucketName); // 创建ObsClient实例 ObsClient obsClient = new ObsClient(hwObsAk, hwObsSk, hwObsEndpoint); ListBucketsRequest request = new ListBucketsRequest(); request.setQueryLocation(true); List<ObsBucket> buckets = obsClient.listBuckets(request); for(ObsBucket bucket : buckets){ logger.info("bucketName:{}, creationDate:{}, location:{}", bucket.getBucketName(), bucket.getCreationDate(), bucket.getLocation()); } } catch (Exception e) { e.printStackTrace(); } } }
上一篇:Synchronized关键字的深入分析-二、Synchronized基本概念


下一篇:面试题6 -- 腐烂的苹果(多源DFS)