Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm not sure what these files are, or more specifically, what the most appropriate storage location would be, but traditionally the best method of IO in this case is via <a href="http://download.oracle.com/javase/1.4.2/docs/api/java/lang/ClassLoader.html" rel="nofollow">ClassLoading</a>. You could create a source folder located at <code>src/main/resources</code> that would be included in the archive (jar, war, ear, etc.) assembly (i.e. these files would be included in the jar). You would then <a href="http://download.oracle.com/javase/1.4.2/docs/guide/resources/resources.html" rel="nofollow">load these resources</a>.</p> <p>If a file is located directly in the package, it will also be included in the artifact assembly, and can be accessed by any class in the package's class loader, or by the default class loader with the package path (packages correspond to folders when an archive is built).</p> <p>If you are using a maven assembly plugin, these resources files would be included automatically. If you're using something like Ant, you would probably need to include these files in a script step. Otherwise I think if you're simply building in Eclipse there's a wizard for including files.</p> <p>Also, the likely reason for attempting to read files from the /home/pc/eclipse folder is because a <a href="http://www.mindspring.com/~mgrand/java-system-properties.htm" rel="nofollow">system property</a> like <code>user.dir</code> or <code>user.home</code> is being utitlized:</p> <pre><code>String filename = System.getProperty("user.dir") + System.getProperty("file.separator") + "file.txt"; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload