title: getResourceAsStream() is not working in built product
body: <p>I am trying to copy the image files from resource folder to local system with using following code.</p>
  
  <pre><code>  InputStream inStream = null;
    OutputStream outStream = null;
    File bfile = new File(directoryPath + "/icons/" + outputFileName);
    inStream = MyClass.class.getClassLoader().getResourceAsStream("/images/" + imgFileName);
    try {
  
          outStream = new FileOutputStream(bfile);
  
          byte[] buffer = new byte[1024];
  
          int length;
  
          if (inStream != null &amp;&amp; outStream != null) {
              // copy the file content in bytes
              while ((length = inStream.read(buffer)) &gt; 0) {
  
                  outStream.write(buffer, 0, length);
  
              }
  
              inStream.close();
              outStream.close();
          } 
          System.out.println("File is copied successful!");
  
      } catch (IOException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>This code works absolutely fine when I run through eclipse. But when i build the product, icons are not getting copied to local system.</p>
  
  <p>I also tried </p>
  
  <pre><code>inStream = MyClass.class.getResourceAsStream("/images/" + imgFileName);
  </code></pre>
  
  <p>but no luck.</p>
  
  <p>Any thoughts! </p>