Examples of CopyObjectResultHandler


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

        }

        HttpResponseAndByteCount methodAndByteCount = performRestPut(
                destinationBucketName, destinationObjectKey, metadata, null, null, false);

        CopyObjectResultHandler handler = getXmlResponseSaxParser()
                .parseCopyObjectResponse(
                        new HttpMethodReleaseInputStream(methodAndByteCount.getHttpResponse()));

        // Release HTTP connection manually. This should already have been done by the
        // HttpMethodReleaseInputStream class, but you can never be too sure...
        releaseConnection(methodAndByteCount.getHttpResponse());

        if(handler.isErrorResponse()) {
            throw new ServiceException(
                    "Copy failed: Code=" + handler.getErrorCode() +
                            ", Message=" + handler.getErrorMessage() +
                            ", RequestId=" + handler.getErrorRequestId() +
                            ", HostId=" + handler.getErrorHostId());
        }

        Map<String, Object> map = new HashMap<String, Object>();

        // Result fields returned when copy is successful.
        map.put("Last-Modified", handler.getLastModified());
        map.put("ETag", handler.getETag());

        // Include information about copy operation in result map, issue #192
        map.put("X-JetS3t-SourceBucketName", sourceBucketName);
        map.put("X-JetS3t-SourceObjectKey", sourceObjectKey);
        map.put("X-JetS3t-DestinationBucketName", destinationBucketName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.