@Override protected void doEndElement(String uri, String name, String qName) { if (in("LifecycleConfiguration")) { if (name.equals("Rule")) { configuration.getRules().add(currentRule); else if (in("LifecycleConfiguration", "Rule")) { if ( name.equals("ID") ) { currentRule.setId(getText()); currentRule.setPrefix(getText()); currentRule.setStatus(getText()); else if (in("LifecycleConfiguration", "Rule", "Expiration")) { if (name.equals("Date")) { currentRule.setExpirationDate(ServiceUtils.parseIso8601Date(getText())); } else if (name.equals("Days")) { currentRule.setExpirationInDays(Integer.parseInt(getText())); } else if (name.equals("ExpiredObjectDeleteMarker")) { if ("true".equals(getText())) { currentRule.setExpiredObjectDeleteMarker(true); else if (in("LifecycleConfiguration", "Rule", "Transition")) { if (name.equals("StorageClass")) { currentTransition.setStorageClass(getText()); } else if (name.equals("Date")) { currentTransition.setDate( ServiceUtils.parseIso8601Date(getText()));
@Override protected void doEndElement(String uri, String name, String qName) { if (in("LifecycleConfiguration")) { if (name.equals("Rule")) { configuration.getRules().add(currentRule); else if (in("LifecycleConfiguration", "Rule")) { if ( name.equals("ID") ) { currentRule.setId(getText()); currentRule.setPrefix(getText()); currentRule.setStatus(getText()); else if (in("LifecycleConfiguration", "Rule", "Expiration")) { if (name.equals("Date")) { currentRule.setExpirationDate(ServiceUtils.parseIso8601Date(getText())); } else if (name.equals("Days")) { currentRule.setExpirationInDays(Integer.parseInt(getText())); } else if (name.equals("ExpiredObjectDeleteMarker")) { if ("true".equals(getText())) { currentRule.setExpiredObjectDeleteMarker(true); else if (in("LifecycleConfiguration", "Rule", "Transition")) { if (name.equals("StorageClass")) { currentTransition.setStorageClass(getText()); } else if (name.equals("Date")) { currentTransition.setDate( ServiceUtils.parseIso8601Date(getText()));
@Override protected void doEndElement(String uri, String name, String qName) { if (in("LifecycleConfiguration")) { if (name.equals("Rule")) { configuration.getRules().add(currentRule); else if (in("LifecycleConfiguration", "Rule")) { if (name.equals("ID")) { currentRule.setId(getText()); currentRule.setPrefix(getText()); currentRule.setStatus(getText()); else if (in("LifecycleConfiguration", "Rule", "Expiration")) { if (name.equals("Date")) { currentRule.setExpirationDate(ServiceUtils.parseIso8601Date(getText())); } else if (name.equals("Days")) { currentRule.setExpirationInDays(Integer.parseInt(getText())); } else if (name.equals("ExpiredObjectDeleteMarker")) { if ("true".equals(getText())) { currentRule.setExpiredObjectDeleteMarker(true); else if (in("LifecycleConfiguration", "Rule", "Transition")) { if (name.equals("StorageClass")) { currentTransition.setStorageClass(getText()); } else if (name.equals("Date")) { currentTransition.setDate( ServiceUtils.parseIso8601Date(getText()));
@Override protected void doStartElement( String uri, String name, String qName, Attributes attrs) { if (in("LifecycleConfiguration")) { if (name.equals("Rule")) { currentRule = new Rule(); } } else if (in("LifecycleConfiguration", "Rule")) { if (name.equals("Transition")) { currentTransition = new Transition(); } else if (name.equals("NoncurrentVersionTransition")) { currentNcvTransition = new NoncurrentVersionTransition(); } else if (name.equals("AbortIncompleteMultipartUpload")) { abortIncompleteMultipartUpload = new AbortIncompleteMultipartUpload(); } else if (name.equals("Filter")) { currentFilter = new LifecycleFilter(); } } else if (in("LifecycleConfiguration", "Rule", "Filter")) { if (name.equals("And")) { andOperandsList = new ArrayList<LifecycleFilterPredicate>(); } } }
@Override protected void doStartElement( String uri, String name, String qName, Attributes attrs) { if (in("LifecycleConfiguration")) { if (name.equals("Rule")) { currentRule = new Rule(); } } else if (in("LifecycleConfiguration", "Rule")) { if (name.equals("Transition")) { currentTransition = new Transition(); } else if (name.equals("NoncurrentVersionTransition")) { currentNcvTransition = new NoncurrentVersionTransition(); } else if (name.equals("AbortIncompleteMultipartUpload")) { abortIncompleteMultipartUpload = new AbortIncompleteMultipartUpload(); } else if (name.equals("Filter")) { currentFilter = new LifecycleFilter(); } } else if (in("LifecycleConfiguration", "Rule", "Filter")) { if (name.equals("And")) { andOperandsList = new ArrayList<LifecycleFilterPredicate>(); } } }
public BucketLifecycleConfiguration unmarshall(InputStream in) throws Exception { return new XmlResponsesSaxParser().parseBucketLifecycleConfigurationResponse(in).getConfiguration(); } }
public BucketLifecycleConfigurationHandler parseBucketLifecycleConfigurationResponse( InputStream inputStream) throws IOException { final BucketLifecycleConfigurationHandler handler = new BucketLifecycleConfigurationHandler(); parseXmlInputStream(handler, inputStream); return handler; }
public BucketLifecycleConfigurationHandler parseBucketLifecycleConfigurationResponse(InputStream inputStream) throws IOException { BucketLifecycleConfigurationHandler handler = new BucketLifecycleConfigurationHandler(); parseXmlInputStream(handler, inputStream); return handler; }
@Override public BucketLifecycleConfiguration unmarshall(InputStream in) throws Exception { return new XmlResponsesSaxParser().parseBucketLifecycleConfigurationResponse(in) .getConfiguration(); } }
@Override protected void doEndElement(String uri, String name, String qName) { if (in("LifecycleConfiguration")) { if (name.equals("Rule")) { configuration.getRules().add(currentRule); else if (in("LifecycleConfiguration", "Rule")) { if (name.equals("ID")) { currentRule.setId(getText()); currentRule.setPrefix(getText()); currentRule.setStatus(getText()); else if (in("LifecycleConfiguration", "Rule", "Expiration")) { if (name.equals("Date")) { currentRule.setExpirationDate(ServiceUtils.parseIso8601Date(getText())); } else if (name.equals("Days")) { currentRule.setExpirationInDays(Integer.parseInt(getText())); } else if (name.equals("ExpiredObjectDeleteMarker")) { if ("true".equals(getText())) { currentRule.setExpiredObjectDeleteMarker(true); else if (in("LifecycleConfiguration", "Rule", "Transition")) { if (name.equals("StorageClass")) { currentTransition.setStorageClass(getText()); } else if (name.equals("Date")) { currentTransition.setDate( ServiceUtils.parseIso8601Date(getText()));
@Override protected void doStartElement( String uri, String name, String qName, Attributes attrs) { if (in("LifecycleConfiguration")) { if (name.equals("Rule")) { currentRule = new Rule(); } } else if (in("LifecycleConfiguration", "Rule")) { if (name.equals("Transition")) { currentTransition = new Transition(); } else if (name.equals("NoncurrentVersionTransition")) { currentNcvTransition = new NoncurrentVersionTransition(); } else if (name.equals("AbortIncompleteMultipartUpload")) { abortIncompleteMultipartUpload = new AbortIncompleteMultipartUpload(); } else if (name.equals("Filter")) { currentFilter = new LifecycleFilter(); } } else if (in("LifecycleConfiguration", "Rule", "Filter")) { if (name.equals("And")) { andOperandsList = new ArrayList<LifecycleFilterPredicate>(); } } }
/** * @param resourceLocation * Location of resource containing XML to unmarshall * @return Marshalled response */ private BucketLifecycleConfiguration parseLifecycleConfiguration(String resourceLocation) throws Exception { return new XmlResponsesSaxParser() .parseBucketLifecycleConfigurationResponse(getClass().getResourceAsStream(resourceLocation)) .getConfiguration(); }
@Override public BucketLifecycleConfiguration unmarshall(InputStream in) throws Exception { return new XmlResponsesSaxParser().parseBucketLifecycleConfigurationResponse(in) .getConfiguration(); } }
public BucketLifecycleConfigurationHandler parseBucketLifecycleConfigurationResponse( InputStream inputStream) throws IOException { final BucketLifecycleConfigurationHandler handler = new BucketLifecycleConfigurationHandler(); parseXmlInputStream(handler, inputStream); return handler; }
@Override protected void doStartElement( String uri, String name, String qName, Attributes attrs) { if (in("LifecycleConfiguration")) { if (name.equals("Rule")) { currentRule = new Rule(); } } else if (in("LifecycleConfiguration", "Rule")) { if (name.equals("Transition")) { currentTransition = new Transition(); } else if (name.equals("NoncurrentVersionTransition")) { currentNcvTransition = new NoncurrentVersionTransition(); } else if (name.equals("AbortIncompleteMultipartUpload")) { abortIncompleteMultipartUpload = new AbortIncompleteMultipartUpload(); } else if (name.equals("Filter")) { currentFilter = new LifecycleFilter(); } } else if (in("LifecycleConfiguration", "Rule", "Filter")) { if (name.equals("And")) { andOperandsList = new ArrayList<LifecycleFilterPredicate>(); } } }
public BucketLifecycleConfiguration unmarshall(InputStream in) throws Exception { return new XmlResponsesSaxParser().parseBucketLifecycleConfigurationResponse(in).getConfiguration(); } }
public BucketLifecycleConfigurationHandler parseBucketLifecycleConfigurationResponse(InputStream inputStream) throws IOException { BucketLifecycleConfigurationHandler handler = new BucketLifecycleConfigurationHandler(); parseXmlInputStream(handler, inputStream); return handler; }