title: Reading a file from /etc/designs in java
body: <p>I'm in need of storing a string in JCR that'll be used in an OSGi bundle(so that it can be modified as needed in CRXde)
  I have stored my string at the location <code>/etc/designs/shc/components/linkcheck/regex.txt/jcr:content</code>, where <code>regex.txt</code> is the file that contains my regex string.</p>
  
  <p>I'm using the following code to read that String in a bundle but with no luck. It is throwing <code>NullPointerException</code> at <code>resourceResolver.getResource</code></p>
  
  <pre><code>Resource dataResource = resourceResolver.getResource("/etc/designs/shc/components/linkcheck/regex.txt/jcr:content"); 
  Node node = dataResource.adaptTo(Node.class);
  String regex = node.getProperty("jcr:data").getValue().toString();
  </code></pre>
  
  <p><code>regex.txt</code> is of type <code>nt:file</code> and the data is visible in CRXde but the code fails.</p>
  
  <p>Any direction will be highly appreciated!</p>