title: Best practices to work with file paths in Java
body: <p>I m trying to load properties file to create a configuration. namely foo.properties.</p>
  
  <p>What the best place to store this config file. Within the package where i will use initialize the using class? on the root level of the src?</p>
  
  <p>Also, while accessing the files, i am using the location of the file in the file system: ie: c:\configs\foo.properties.</p>
  
  <p>Is there a better practice for this? such as using the path relative to the project rather than the file system location? if yes, how can i reference the location of a property file within a project tree. such as:</p>
  
  <pre><code>src/
     /com.foo.bar
     /com.foo.car
     /com.foo.zar
     foo.properties
  </code></pre>
  
  <p>lets say i want to read the properties file to memory, how do i access this foo.properties without using the OS location/ or the location in the file system.</p>