title: Wicket create image from file system outside web application directory
body: <p>I have a repository storing many images somewhere on the server.
  I want to be able to create a dynamic Image object with one of the images stored in my repository.</p>
  
  <p>I am using wicket 1.5.7. I saw this example somewhere</p>
  
  <p>1) Created the FileResource class:</p>
  
  <pre><code>public class FileResource extends WebResource { 
  private static final long serialVersionUID = 1L; 
  
  private File file; 
  
  public FileResource(File file) { 
      this.file = file; 
  } 
  
  @Override 
  public IResourceStream getResourceStream() { 
      return new FileResourceStream(file); 
  } 
  }
  </code></pre>
  
  <p>2) In MyPage.java: </p>
  
  <pre><code>File imageFile = new File("local_path_to_image"); 
  Image myImage = new Image("myImage", new FileResource(imageFile)); 
  add(myImage);
  </code></pre>
  
  <p>3) In MyPage.html: </p>
  
  <pre><code>&lt;i-m-g wicket:id="myImage" /&gt;
  </code></pre>
  
  <p>But this is not working in my case because WebResource is not available in my wicket 1.5.</p>
  
  <p>I have also studied this <a href="http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/" rel="nofollow">link</a> in wicket action. But I am a wicket bignner i could not understand much.</p>
  
  <p>I am making a project in which user when click on a product a modal window open with the product name. I also want to include the product image on my modal window inside a panel. Images are stored on my server in a directory. </p>
  
  <p>Any help and advices appreciated! Thanks in advance.</p>