title: How to get images from a folder in the server using Jersey WS?
body: <p>I am learning the Jersey web services, now I understood how GET and POST work :</p>
  
  <pre><code> @GET
      @Produces("text/html")
      public String getHandler() {
          return "&lt;h1&gt;Get some REST!&lt;h1&gt;";
      }
  
  @POST
  @Consumes("application/x-www-form-urlencoded")
  @Produces("text/plain")
  public String postHandler(String content) {
      return content;
  } 
  </code></pre>
  
  <p>in Jersey Documentation for featching images it said :</p>
  
  <pre><code>@GET
  @Path("/images/{image}")
  @Produces("image/*")
  public Response getImage(@PathParam("image") String image) {
    if (!isSafeToOpenFile(image)) {
      throw new IllegalArgumentException("Cannot open the image file.");
    }
  
    File f = new File(image);
  
    if (!f.exists()) {
      throw new WebApplicationException(404);
    }
  
    String mt = new MimetypesFileTypeMap().getContentType(f);
    return Response.ok(f, mt).build();
  }
  </code></pre>
  
  <p>I would appreciated if you can show me an example using the above code to fetch images from a folder in the server and post them in a html.
  Thanks lot.</p>