org.jets3t.service.impl.rest
Class XmlResponsesSaxParser

java.lang.Object
  extended by org.jets3t.service.impl.rest.XmlResponsesSaxParser

public class XmlResponsesSaxParser
extends Object

XML Sax parser to read XML documents returned by S3 via the REST interface, converting these documents into JetS3t objects.

Author:
James Murty

Nested Class Summary
 class XmlResponsesSaxParser.AccessControlListHandler
          Handler for AccessControlList response XML documents.
 class XmlResponsesSaxParser.BucketLocationHandler
          Handler for CreateBucketConfiguration response XML documents for a bucket.
 class XmlResponsesSaxParser.BucketLoggingStatusHandler
          Handler for LoggingStatus response XML documents for a bucket.
 class XmlResponsesSaxParser.CopyObjectResultHandler
           
 class XmlResponsesSaxParser.ListAllMyBucketsHandler
          Handler for ListAllMyBuckets response XML documents.
 class XmlResponsesSaxParser.ListBucketHandler
          Handler for ListBucket response XML documents.
 class XmlResponsesSaxParser.ListVersionsResultsHandler
           
 class XmlResponsesSaxParser.MyDefaultHandler
           
 class XmlResponsesSaxParser.RequestPaymentConfigurationHandler
          Handler for RequestPaymentConfiguration response XML documents for a bucket.
 class XmlResponsesSaxParser.VersioningConfigurationHandler
           
 
Constructor Summary
XmlResponsesSaxParser(Jets3tProperties properties)
          Constructs the XML SAX parser.
 
Method Summary
 XmlResponsesSaxParser.AccessControlListHandler parseAccessControlListResponse(InputStream inputStream)
          Parses an AccessControlListHandler response XML document from an input stream.
 String parseBucketLocationResponse(InputStream inputStream)
           
 XmlResponsesSaxParser.CopyObjectResultHandler parseCopyObjectResponse(InputStream inputStream)
           
 XmlResponsesSaxParser.ListBucketHandler parseListBucketResponse(InputStream inputStream)
          Parses a ListBucket response XML document from an input stream.
 XmlResponsesSaxParser.ListAllMyBucketsHandler parseListMyBucketsResponse(InputStream inputStream)
          Parses a ListAllMyBuckets response XML document from an input stream.
 XmlResponsesSaxParser.ListVersionsResultsHandler parseListVersionsResponse(InputStream inputStream)
           
 XmlResponsesSaxParser.BucketLoggingStatusHandler parseLoggingStatusResponse(InputStream inputStream)
          Parses a LoggingStatus response XML document for a bucket from an input stream.
 boolean parseRequestPaymentConfigurationResponse(InputStream inputStream)
           
 S3BucketVersioningStatus parseVersioningConfigurationResponse(InputStream inputStream)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlResponsesSaxParser

public XmlResponsesSaxParser(Jets3tProperties properties)
                      throws S3ServiceException
Constructs the XML SAX parser.

Parameters:
properties - the JetS3t properties that will be applied when parsing XML documents.
Throws:
S3ServiceException
Method Detail

parseListBucketResponse

public XmlResponsesSaxParser.ListBucketHandler parseListBucketResponse(InputStream inputStream)
                                                                throws S3ServiceException
Parses a ListBucket response XML document from an input stream.

Parameters:
inputStream - XML data input stream.
Returns:
the XML handler object populated with data parsed from the XML stream.
Throws:
S3ServiceException

parseListMyBucketsResponse

public XmlResponsesSaxParser.ListAllMyBucketsHandler parseListMyBucketsResponse(InputStream inputStream)
                                                                         throws S3ServiceException
Parses a ListAllMyBuckets response XML document from an input stream.

Parameters:
inputStream - XML data input stream.
Returns:
the XML handler object populated with data parsed from the XML stream.
Throws:
S3ServiceException

parseAccessControlListResponse

public XmlResponsesSaxParser.AccessControlListHandler parseAccessControlListResponse(InputStream inputStream)
                                                                              throws S3ServiceException
Parses an AccessControlListHandler response XML document from an input stream.

Parameters:
inputStream - XML data input stream.
Returns:
the XML handler object populated with data parsed from the XML stream.
Throws:
S3ServiceException

parseLoggingStatusResponse

public XmlResponsesSaxParser.BucketLoggingStatusHandler parseLoggingStatusResponse(InputStream inputStream)
                                                                            throws S3ServiceException
Parses a LoggingStatus response XML document for a bucket from an input stream.

Parameters:
inputStream - XML data input stream.
Returns:
the XML handler object populated with data parsed from the XML stream.
Throws:
S3ServiceException

parseBucketLocationResponse

public String parseBucketLocationResponse(InputStream inputStream)
                                   throws S3ServiceException
Throws:
S3ServiceException

parseCopyObjectResponse

public XmlResponsesSaxParser.CopyObjectResultHandler parseCopyObjectResponse(InputStream inputStream)
                                                                      throws S3ServiceException
Throws:
S3ServiceException

parseRequestPaymentConfigurationResponse

public boolean parseRequestPaymentConfigurationResponse(InputStream inputStream)
                                                 throws S3ServiceException
Parameters:
inputStream -
Returns:
true if the bucket is configured as Requester Pays, false if it is configured as Owner pays.
Throws:
S3ServiceException

parseVersioningConfigurationResponse

public S3BucketVersioningStatus parseVersioningConfigurationResponse(InputStream inputStream)
                                                              throws S3ServiceException
Parameters:
inputStream -
Returns:
true if the bucket has versioning enabled, false otherwise.
Throws:
S3ServiceException

parseListVersionsResponse

public XmlResponsesSaxParser.ListVersionsResultsHandler parseListVersionsResponse(InputStream inputStream)
                                                                           throws S3ServiceException
Throws:
S3ServiceException