All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ksyun.ks3.service.response.GetBucketReplicationConfigurationResponse Maven / Gradle / Ivy

package com.ksyun.ks3.service.response;

import com.ksyun.ks3.dto.ReplicationRule;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;

import java.util.ArrayList;
import java.util.List;

public class GetBucketReplicationConfigurationResponse extends Ks3WebServiceXmlResponse {
    private List prefixList = new ArrayList();
    private String targetBucket;
    private boolean deleteMarkerStatus;

    public int[] expectedStatus() {
        return new int[]{200};
    }

    @Override
    public void preHandle() {
    }

    public void startDocument() throws SAXException {
        result = new ReplicationRule();
    }

    public void startEle(String uri, String localName, String qName, Attributes attributes) throws SAXException {

    }

    public void endEle(String uri, String localName, String qName) throws SAXException {
        if ("Replication".equals(getTag())) {
            result.setTargetBucket(targetBucket);
            result.setPrefixList(prefixList);
            result.setDeleteMarkerStatus(deleteMarkerStatus);
        }
    }

    @Override
    public void string(String s) {
        if ("prefix".equals(getTag())) {
            prefixList.add(s);
        } else if ("targetBucket".equals(getTag())) {
            targetBucket = s;
        } else if (ReplicationRule.ENABLED.equals(s)) {
            deleteMarkerStatus = true;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy