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 ClassLoading. You could create a source folder located at src/main/resources
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 load these resources.
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).
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.
Also, the likely reason for attempting to read files from the /home/pc/eclipse folder is because a system property like user.dir
or user.home
is being utitlized:
String filename = System.getProperty("user.dir") + System.getProperty("file.separator") + "file.txt";