org.jets3t.service.impl.rest
Class XmlResponsesSaxParser

java.lang.Object
  extended byorg.jets3t.service.impl.rest.XmlResponsesSaxParser

public class XmlResponsesSaxParser
extends java.lang.Object

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


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.
 
Constructor Summary
XmlResponsesSaxParser()
          Constructs the XML SAX parser.
XmlResponsesSaxParser(Jets3tProperties properties)
          Constructs the XML SAX parser.
 
Method Summary
 XmlResponsesSaxParser.AccessControlListHandler parseAccessControlListResponse(java.io.InputStream inputStream)
          Parses an AccessControlListHandler response XML document from an input stream.
 java.lang.String parseBucketLocationResponse(java.io.InputStream inputStream)
           
 XmlResponsesSaxParser.CopyObjectResultHandler parseCopyObjectResponse(java.io.InputStream inputStream)
           
 XmlResponsesSaxParser.ListBucketHandler parseListBucketObjectsResponse(java.io.InputStream inputStream)
          Parses a ListBucket response XML document from an input stream.
 XmlResponsesSaxParser.ListAllMyBucketsHandler parseListMyBucketsResponse(java.io.InputStream inputStream)
          Parses a ListAllMyBuckets response XML document from an input stream.
 XmlResponsesSaxParser.BucketLoggingStatusHandler parseLoggingStatusResponse(java.io.InputStream inputStream)
          Parses a LoggingStatus response XML document for a bucket from an input stream.
protected  void parseXmlInputStream(org.xml.sax.helpers.DefaultHandler handler, java.io.InputStream inputStream)
          Parses an XML document from an input stream using a document handler.
protected  java.io.InputStream sanitizeXmlDocument(org.xml.sax.helpers.DefaultHandler handler, java.io.InputStream inputStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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

XmlResponsesSaxParser

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

Throws:
S3ServiceException
Method Detail

parseXmlInputStream

protected void parseXmlInputStream(org.xml.sax.helpers.DefaultHandler handler,
                                   java.io.InputStream inputStream)
                            throws S3ServiceException
Parses an XML document from an input stream using a document handler.

Parameters:
handler - the handler for the XML document
inputStream - an input stream containing the XML document to parse
Throws:
S3ServiceException - any parsing, IO or other exceptions are wrapped in an S3ServiceException.

sanitizeXmlDocument

protected java.io.InputStream sanitizeXmlDocument(org.xml.sax.helpers.DefaultHandler handler,
                                                  java.io.InputStream inputStream)
                                           throws S3ServiceException
Throws:
S3ServiceException

parseListBucketObjectsResponse

public XmlResponsesSaxParser.ListBucketHandler parseListBucketObjectsResponse(java.io.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(java.io.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(java.io.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(java.io.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 java.lang.String parseBucketLocationResponse(java.io.InputStream inputStream)
                                             throws S3ServiceException
Throws:
S3ServiceException

parseCopyObjectResponse

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