Package org.jets3t.service.model

Examples of org.jets3t.service.model.StorageObject.replaceAllMetadata()


        responseObject.setKey(objectKey);
        if(!headOnly) {
            responseObject.setContentLength(httpResponse.getEntity().getContentLength());
        }
        responseObject.setBucketName(bucketName);
        responseObject.replaceAllMetadata(ServiceUtils.cleanRestMetadataMap(
                map, this.getRestHeaderPrefix(), this.getRestMetadataPrefix()));
        responseObject.setMetadataComplete(true); // Flag this object as having the complete metadata set.
        if(!headOnly) {
            HttpMethodReleaseInputStream releaseIS = new HttpMethodReleaseInputStream(httpResponse);
            responseObject.setDataInputStream(releaseIS);
View Full Code Here


            uploadedObject.setBucketName(uploadedObject.getBucketName());

            // Add all metadata returned by S3 to uploaded object.
            Map<String, Object> map = new HashMap<String, Object>();
            map.putAll(convertHeadersToMap(httpResponse.getAllHeaders()));
            uploadedObject.replaceAllMetadata(ServiceUtils.cleanRestMetadataMap(
                    map, this.getRestHeaderPrefix(), this.getRestMetadataPrefix()));

            // Confirm that the data was not corrupted in transit by checking S3's calculated
            // hash value with the locally computed value. This is only necessary if the user
            // did not provide a Content-MD5 header with the original object.
View Full Code Here

        // Replace all
        newMetadata = new HashMap<String, Object>();
        newMetadata.put("one", "1st");
        newMetadata.put("TWO", "2nd");
        newMetadata.put("THRee", "3rd");
        obj.replaceAllMetadata(newMetadata);
        assertEquals(3, obj.getMetadataMap().size());
        assertEquals("1st", obj.getMetadata("ONE"));
        assertEquals("2nd", obj.getMetadata("two"));
        assertEquals("3rd", obj.getMetadata("thrEE"));
    }
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.