Issue while creating asset using Asset Manager | Community
Skip to main content
AsifChowdhury
New Participant
May 24, 2023 10:06 AM UTC
Solved

Issue while creating asset using Asset Manager

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); }

 

In crx 1st one is showing

dam:assetState
String
unProcessed

 

Any idea will be appreciable.

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
AsifChowdhury
AsifChowdhuryAccepted solution
New Participant
May 24, 2023 11:42 AM UTC

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

2 replies

AsifChowdhury
AsifChowdhuryAuthorAccepted solution
New Participant
May 24, 2023 11:42 AM UTC

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

Translate
aanchal-sikka
New Participant
May 24, 2023 11:37 AM UTC

@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.

Translate
Aanchal Sikka