title: If I have a constructor that requires a path to a file, how can I "fake" that if it is packaged into a jar?
body: <p>The context of this question is that I am trying to use the maxmind java api in a pig script that I have written... I do not think that knowing about either is necessary to answer the question, however.</p>
  
  <p>The maxmind API has a constructor which requires a path to a file called GeoIP.dat, which is a comma delimited file which has the information it needs.</p>
  
  <p>I have a jar file which contains the API, as well as a wrapping class which instantiates the class and uses it. My idea is to package the GeoIP.dat file into the jar, and then access it as a resource in the jar file. The issue is that I do not know how to construct a path that the constructor can use.</p>
  
  <p>Looking at the API, this is how they load the file:</p>
  
  <pre><code>public LookupService(String databaseFile) throws IOException {
      this(new File(databaseFile));
  }
  
  
  public LookupService(File databaseFile) throws IOException {
      this.databaseFile = databaseFile;
      this.file = new RandomAccessFile(databaseFile, "r");
      init();
  }
  </code></pre>
  
  <p>I only paste that because I am not averse to editing the API itself to make this work, if necessary, but do not know how I could replicate the functionality I as such. Ideally I'd like to get it into the file form, though, or else editing the API will be quite a chore.</p>
  
  <p>Is this possible?</p>