Package com.amazon.s3shell

Examples of com.amazon.s3shell.S3Store.storeItem()


    public static String storeFile(String id, String mimetype, final byte[] bytes) throws IOException {
        S3Store store = S3Store.getInstance();
        Map<String, List<String>> headers = new HashMap<String, List<String>>();
        headers.put("Content-Type", new ArrayList<String>());
        headers.get("Content-Type").add(mimetype);
        if (store.storeItem(id, bytes, ACLConstants.PUBLIC_READ, headers)) {
            return String.format("http://%s/%s/%s", store.getHost(), store.getBucket(), id);
        } else {
            return null;
        }
    }
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.