title: Passing a File to another maching with a same JAR file
body: <p>Here is my problem.</p>
  
  <p>My package setup is:</p>
  
  <pre><code>-src
  ---- foo
  -------- code.java    
  ---- foo.data
  -------- files I need to access
  </code></pre>
  
  <p>Currently I have a jar that contains all of the above files I need to access. I will be running this code on my machine and send File objects initialized on my machine to another machine with the same jar running.</p>
  
  <p>My question is how can I obtain a relative path to the data file so when I send the File objects to the other machine they know to look in the jar?</p>
  
  <p>I need to access the data file so I can perform methods on it. Therefore I need to create a new File(relative/path/to/jar/data/files) with it and then I will be passing the File objects to another computer to compute. </p>
  
  <p>Currently I have been able to use getClass().getResource("data/" + "filename").getPath() this gives me a path like file:/pathtojar!/pathtofileinjar/ which I think will be able to find the jar in the other machine but I am getting null pointer when trying to use the item in the jar.  Are files in jar able to be used or is there a workaround for it?</p>