Storing JSON or JSONObject into Amazon S3 with Java

Yes, you're pretty much dealing with bytes here so whatever format these bytes represent has no impact at all.

In your java app, convert whatever object you have into bytes then stream that out directly (or write to a file first, then upload). Sample code:

 ObjectMapper objectMapper = new ObjectMapper(); 
 byte[] bytesToWrite = objectMapper.writeValueAsBytes(yourObject)

 ObjectMetadata omd = new ObjectMetadata();
 omd.setContentLength(bytesToWrite.length);
 transferManager.upload(bucketName, filename, new ByteArrayInputStream(bytesToWrite), omd);

The java client can be found here: https://aws.amazon.com/sdk-for-java/


Yes.

Just use putObject(String bucketName, String key, String content), passing your JSON String for content.