Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Issue while creating asset using Asset Manager

Avatar

Community Advisor

I am trying to create assets in DAM using AssetManeger. I am calling the createAsset method two times. but one asset is creating successfully but another one is not getting successfully created. One is showing pending.

 

Asset asset = createAsset(resourceResolver, mainCsvInputStream, filePath);
Asset report = createAsset(resourceResolver, reportInputStream, reportFilePath);
private Asset createAsset(ResourceResolver resourceResolver, InputStream inputStream, String path){
        AssetManager assetManager = resourceResolver.adaptTo(AssetManager.class);
        return assetManager.createAsset(path, inputStream, "text/csv", true);
}

 

AsifChowdhury_0-1684922744538.png

In crx 1st one is showing

dam:assetState
String
unProcessed

 

Any idea will be appreciable.

Thanks

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Problem resolved. Somehow I was doing some operations with the inputStream for that 2nd time the inputStream was not valid.

View solution in original post

2 Replies

Avatar

Community Advisor

@AsifChowdhury 

 

Can you please try re-processing these 2 assets with OOTB workflows?

That should help us rule-out if the asset itself is corrupted (inputStream). Or may be these inputStream differ in some other way.


Aanchal Sikka

Avatar

Correct answer by
Community Advisor

Problem resolved. Somehow I was doing some operations with the inputStream for that 2nd time the inputStream was not valid.