title: java read file for ftp upload from jar file
body: <p>I am trying to upload files by ftp using the apache common library. I want to keep those file inside the jar, since these are files that will stay the same and need to be uploaded on the different hosts several time. </p>
  
  <p>I am trying the following:</p>
  
  <pre><code>    public void doCGIRecovery() throws IOException{
      System.out.println(getClass().getResource("/cgi/example").getPath());
      FileInputStream file = new FileInputStream(getClass().getResource("/cgi/example").getPath());
      f.storeFile("./", file);
  }
  </code></pre>
  
  <p>Using eclipse this works and the sysout is giving me:</p>
  
  <pre><code>/Users/user/Documents/workspace/example-Project/bin/com/example/java/example/business/cgi/example
  </code></pre>
  
  <p>But after the compilation into a jar it returns me the following:</p>
  
  <pre><code>file:/Users/user/Desktop/example.jar!/com/example/java/example/business/cgi/example
  </code></pre>
  
  <p>And I get (No such file or directory).</p>
  
  <p>So how does that come? Further where does the "!" after example.jar come from?</p>
  
  <p>Best Regards</p>