//asset nullpointer exception
Asset asset = assetMgr.createAsset(assetDetails.getDamPath(), inputStream, "image/jpeg", true);
Resource metadataRes = asset.adaptTo(Resource.class).getChild("jcr:content/metadata");
ModifiableValueMap map = metadataRes.adaptTo(ModifiableValueMap.class);
map.remove("dc:title");
map.put("dc:description", assetDetails.getAssetDescription());
map.put("sourceId", assetDetails.getSourceId());
map.put("dc:title", assetDetails.getAssetTitle());
resourceResolver.commit();
将asset
视为空。
有其他方法可以获得资源吗?