title: Jackrabbit file storage
body: <p>I want to test saving and retrieving of files using Apache Jackrabbit.  I am not sure if it's saving when I am not able to retrieve it later.  The following is my code.  My question is how do I retrieve the file that I have saved.</p>
  <pre class="lang-java prettyprint-override"><code>    @Test
      public void storeFile() throws Exception {
          File file = getFile();
          FileInputStream fileInputStream = new FileInputStream(file);
           
          Repository repository = new TransientRepository(); 
          Session session = repository.login( 
          new SimpleCredentials(&quot;username&quot;, &quot;password&quot;.toCharArray())); 
          try { 
              logger.info(&quot;logged in as user '{}'&quot;, session.getUserID());
              Node root = session.getRootNode(); 
  
              // Store content 
              Node hello = root.addNode(&quot;userid_12&quot;); 
              Node world = hello.addNode(&quot;files&quot;); 
              
              
              logger.debug(&quot;setting fileInputStream&quot;);
              world.getSession().getValueFactory().createBinary(fileInputStream);
              
              session.save(); 
  
              // Retrieve content 
              Node node = root.getNode(&quot;userid_12/files&quot;); 
              logger.info(node.getPath()); 
              //how do I retrieve the file now?
            }
  </code></pre>