5 Replies Latest reply on Mar 11, 2013 5:43 PM by deepbluez

    Using AssetManager retrieve asset from DAM getting NullPointer

    deepbluez Level 1



      I'm trying to use AssetManager to retrieve an asset from DAM. The asset itself is a txt file which I need to read the content once the asset is obtained.


      Here's my code:


      AssetManager manager = resourceResolver.adaptTo(AssetManager.class);

      Asset footerLn1 = manager.getAssetForBinary("content/dam/mysite/texts/footer-line1.txt");


      I'm getting NullPointerException on line 2.


      Also tried the path: var/dam/mysite/texts/footer-line1.txt, same error.


      The file does exist in the above location.