Hi,
- I have a file called sample.json on my local drive
- I open my AEM 6.5.12 instance and browse into assets, /content/dam/we-retail
- I drag and drop the sample.json into the browser window, triggering the upload it
- sample.json is now being displayed as asset
- I hit localhost:4502/content/dam/we-retail/sample.json
- It is downloading the JSON file and it can be displayed correctly.
If you are looking for creating the Dam asset from the java code then you can first convert the json object into the input stream using the code as below:
String str = json.getJSONObject("data").toString();
InputStream is = new ByteArrayInputStream(str.getBytes());and if you already hava a file you can use as below:
InputStream fis = new FileInputStream(savedFile);
And once you get the input stream you can process it to AEM via the following code:
AssetManager am = resolver.adaptTo(AssetManager.class);
Asset asset = am.createAsset(assetsPath, is, mimeType, true);
In the above using the mimeType as below:

Thanks