Package org.jets3t.service.impl.rest.XmlResponsesSaxParser

Examples of org.jets3t.service.impl.rest.XmlResponsesSaxParser.ListBucketHandler


            } else {
                parameters.remove("marker");
            }
           
            HttpMethodBase httpMethod = performRestGet(bucketName, null, parameters, null);
            ListBucketHandler listBucketHandler = null;
           
            try {
                listBucketHandler = (new XmlResponsesSaxParser())
                    .parseListBucketObjectsResponse(
                        new HttpMethodReleaseInputStream(httpMethod));
                ioErrorRetryCount = 0;
            } catch (S3ServiceException e) {
                if (e.getCause() instanceof IOException && ioErrorRetryCount < 5) {
                    ioErrorRetryCount++;
                    log.warn("Retrying bucket listing failure due to IO error", e);                   
                    continue;
                } else {
                    throw e;
                }
            }
           
            S3Object[] partialObjects = listBucketHandler.getObjects();
            log.debug("Found " + partialObjects.length + " objects in one batch");
            objects.addAll(Arrays.asList(partialObjects));
           
            String[] partialCommonPrefixes = listBucketHandler.getCommonPrefixes();
            log.debug("Found " + partialCommonPrefixes.length + " common prefixes in one batch");
            commonPrefixes.addAll(Arrays.asList(partialCommonPrefixes));
           
            incompleteListing = listBucketHandler.isListingTruncated();           
            if (incompleteListing) {
                priorLastKey = listBucketHandler.getMarkerForNextListing();               
                log.debug("Yet to receive complete listing of bucket contents, "
                        + "last key for prior chunk: " + priorLastKey);
            } else {
                priorLastKey = null;
            }
View Full Code Here


            } else {
                parameters.remove("marker");
            }
           
            HttpMethodBase httpMethod = performRestGet(bucketName, null, parameters, null);
            ListBucketHandler listBucketHandler = null;
           
            try {
                listBucketHandler = (new XmlResponsesSaxParser())
                    .parseListBucketObjectsResponse(
                        new HttpMethodReleaseInputStream(httpMethod));
                ioErrorRetryCount = 0;
            } catch (S3ServiceException e) {
                if (e.getCause() instanceof IOException && ioErrorRetryCount < 5) {
                    ioErrorRetryCount++;
                    if (log.isWarnEnabled()) {
                        log.warn("Retrying bucket listing failure due to IO error", e);
                    }
                    continue;
                } else {
                    throw e;
                }
            }
           
            S3Object[] partialObjects = listBucketHandler.getObjects();
            if (log.isDebugEnabled()) {
                log.debug("Found " + partialObjects.length + " objects in one batch");
            }
            objects.addAll(Arrays.asList(partialObjects));
           
            String[] partialCommonPrefixes = listBucketHandler.getCommonPrefixes();
            if (log.isDebugEnabled()) {
                log.debug("Found " + partialCommonPrefixes.length + " common prefixes in one batch");
            }
            commonPrefixes.addAll(Arrays.asList(partialCommonPrefixes));
           
            incompleteListing = listBucketHandler.isListingTruncated();           
            if (incompleteListing) {
                priorLastKey = listBucketHandler.getMarkerForNextListing();
                if (log.isDebugEnabled()) {
                    log.debug("Yet to receive complete listing of bucket contents, "
                        + "last key for prior chunk: " + priorLastKey);
                }
            } else {
View Full Code Here

            } else {
                parameters.remove("marker");
            }
           
            HttpMethodBase httpMethod = performRestGet(bucketName, null, parameters, null);
            ListBucketHandler listBucketHandler = null;
           
            try {
                listBucketHandler = (new XmlResponsesSaxParser())
                    .parseListBucketObjectsResponse(
                        new HttpMethodReleaseInputStream(httpMethod));
                ioErrorRetryCount = 0;
            } catch (S3ServiceException e) {
                if (e.getCause() instanceof IOException && ioErrorRetryCount < 5) {
                    ioErrorRetryCount++;
                    if (log.isWarnEnabled()) {
                        log.warn("Retrying bucket listing failure due to IO error", e);
                    }
                    continue;
                } else {
                    throw e;
                }
            }
           
            S3Object[] partialObjects = listBucketHandler.getObjects();
            if (log.isDebugEnabled()) {
                log.debug("Found " + partialObjects.length + " objects in one batch");
            }
            objects.addAll(Arrays.asList(partialObjects));
           
            String[] partialCommonPrefixes = listBucketHandler.getCommonPrefixes();
            if (log.isDebugEnabled()) {
                log.debug("Found " + partialCommonPrefixes.length + " common prefixes in one batch");
            }
            commonPrefixes.addAll(Arrays.asList(partialCommonPrefixes));
           
            incompleteListing = listBucketHandler.isListingTruncated();           
            if (incompleteListing) {
                priorLastKey = listBucketHandler.getMarkerForNextListing();
                if (log.isDebugEnabled()) {
                    log.debug("Yet to receive complete listing of bucket contents, "
                        + "last key for prior chunk: " + priorLastKey);
                }
            } else {
View Full Code Here

            else {
                parameters.remove("marker");
            }

            HttpResponse httpResponse = performRestGet(bucketName, null, parameters, null);
            ListBucketHandler listBucketHandler;

            try {
                listBucketHandler = getXmlResponseSaxParser()
                        .parseListBucketResponse(
                                new HttpMethodReleaseInputStream(httpResponse));
                ioErrorRetryCount = 0;
            }
            catch(ServiceException e) {
                if(e.getCause() instanceof IOException && ioErrorRetryCount < 5) {
                    ioErrorRetryCount++;
                    if(log.isWarnEnabled()) {
                        log.warn("Retrying bucket listing failure due to IO error", e);
                    }
                    continue;
                }
                else {
                    throw e;
                }
            }

            StorageObject[] partialObjects = listBucketHandler.getObjects();
            if(log.isDebugEnabled()) {
                log.debug("Found " + partialObjects.length + " objects in one batch");
            }
            objects.addAll(Arrays.asList(partialObjects));

            String[] partialCommonPrefixes = listBucketHandler.getCommonPrefixes();
            if(log.isDebugEnabled()) {
                log.debug("Found " + partialCommonPrefixes.length + " common prefixes in one batch");
            }
            commonPrefixes.addAll(Arrays.asList(partialCommonPrefixes));

            incompleteListing = listBucketHandler.isListingTruncated();
            if(incompleteListing) {
                priorLastKey = listBucketHandler.getMarkerForNextListing();
                if(log.isDebugEnabled()) {
                    log.debug("Yet to receive complete listing of bucket contents, "
                            + "last key for prior chunk: " + priorLastKey);
                }
            }
View Full Code Here

TOP

Related Classes of org.jets3t.service.impl.rest.XmlResponsesSaxParser.ListBucketHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.