Issue while creating asset using Asset Manager | Community
Skip to main content
AsifChowdhury
Community Advisor
Community Advisor
May 24, 2023
Solved

Issue while creating asset using Asset Manager

  • May 24, 2023
  • 2 replies
  • 866 views

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.
Best answer by AsifChowdhury

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

2 replies

aanchal-sikka
Community Advisor
Community Advisor
May 24, 2023

@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
AsifChowdhury
Community Advisor
AsifChowdhuryCommunity AdvisorAuthorAccepted solution
Community Advisor
May 24, 2023

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