User user = getCurrentUser();
return user == null ? null : user.getEmail();
}
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;
}
}