public static BucketStat parseGetBucketStat()

in src/main/java/com/aliyun/oss/internal/ResponseParsers.java [2855:2904]


    public static BucketStat parseGetBucketStat(InputStream responseBody) throws ResponseParseException {
        try {
            Element root = getXmlRootElement(responseBody);
            Long storage = Long.parseLong(root.getChildText("Storage"));
            Long objectCount = Long.parseLong(root.getChildText("ObjectCount"));
            Long multipartUploadCount = Long.parseLong(root.getChildText("MultipartUploadCount"));
            Long liveChannelCount = parseLongWithDefault(root.getChildText("LiveChannelCount"));
            Long lastModifiedTime = parseLongWithDefault(root.getChildText("LastModifiedTime"));
            Long standardStorage = parseLongWithDefault(root.getChildText("StandardStorage"));
            Long standardObjectCount = parseLongWithDefault(root.getChildText("StandardObjectCount"));
            Long infrequentAccessStorage = parseLongWithDefault(root.getChildText("InfrequentAccessStorage"));
            Long infrequentAccessRealStorage = parseLongWithDefault(root.getChildText("InfrequentAccessRealStorage"));
            Long infrequentAccessObjectCount = parseLongWithDefault(root.getChildText("InfrequentAccessObjectCount"));
            Long archiveStorage = parseLongWithDefault(root.getChildText("ArchiveStorage"));
            Long archiveRealStorage = parseLongWithDefault(root.getChildText("ArchiveRealStorage"));
            Long archiveObjectCount = parseLongWithDefault(root.getChildText("ArchiveObjectCount"));
            Long coldArchiveStorage = parseLongWithDefault(root.getChildText("ColdArchiveStorage"));
            Long coldArchiveRealStorage = parseLongWithDefault(root.getChildText("ColdArchiveRealStorage"));
            Long coldArchiveObjectCount = parseLongWithDefault(root.getChildText("ColdArchiveObjectCount"));
            Long deepColdArchiveStorage = parseLongWithDefault(root.getChildText("DeepColdArchiveStorage"));
            Long deepColdArchiveRealStorage = parseLongWithDefault(root.getChildText("DeepColdArchiveRealStorage"));
            Long deepColdArchiveObjectCount = parseLongWithDefault(root.getChildText("DeepColdArchiveObjectCount"));
            BucketStat bucketStat = new BucketStat()
                    .withStorageSize(storage)
                    .withObjectCount(objectCount)
                    .withMultipartUploadCount(multipartUploadCount)
                    .withLiveChannelCount(liveChannelCount)
                    .withLastModifiedTime(lastModifiedTime)
                    .withStandardStorage(standardStorage)
                    .withStandardObjectCount(standardObjectCount)
                    .withInfrequentAccessStorage(infrequentAccessStorage)
                    .withInfrequentAccessRealStorage(infrequentAccessRealStorage)
                    .withInfrequentAccessObjectCount(infrequentAccessObjectCount)
                    .withArchiveStorage(archiveStorage)
                    .withArchiveRealStorage(archiveRealStorage)
                    .withArchiveObjectCount(archiveObjectCount)
                    .withColdArchiveStorage(coldArchiveStorage)
                    .withColdArchiveRealStorage(coldArchiveRealStorage)
                    .withColdArchiveObjectCount(coldArchiveObjectCount)
                    .withDeepColdArchiveStorage(deepColdArchiveStorage)
                    .withDeepColdArchiveRealStorage(deepColdArchiveRealStorage)
                    .withDeepColdArchiveObjectCount(deepColdArchiveObjectCount);

            return bucketStat;
        } catch (JDOMParseException e) {
            throw new ResponseParseException(e.getPartialDocument() + ": " + e.getMessage(), e);
        } catch (Exception e) {
            throw new ResponseParseException(e.getMessage(), e);
        }
    }