title: Load Properties from resources folder within JAR
body: <p>I have a JAR file Movie Library.jar, its contents are depicted below:</p>
  
  <p><img src="https://i.stack.imgur.com/eMHgk.png" alt="enter image description here"></p>
  
  <p>The class PropertiesUtils is resides in the client.jar (shown in picture) and the properties files are in properties folder which resides in resources folder. </p>
  
  <p>I am trying to load properties as:</p>
  
  <pre><code>String absolutePath = LazyProperties.class.getClass().getResource(filePath).getPath();
  File file = new File(absolutePath);
  InputStream stream = new FileInputStream(file);
  Properties properties = new Properties();
  properties.load(stream);
  </code></pre>
  
  <p>But it is showing:</p>
  
  <pre><code>file:\D:\Code\MovieLibrary\build\jar\Movie%20Library.jar!\resources\properties\movie_library.properties (The filename, directory name, or volume label syntax is incorrect)
  </code></pre>
  
  <p>I am unable to figure it as <code>System.out.println(file)</code> prints:</p>
  
  <pre><code>file:/D:/Code/MovieLibrary/build/jar/Movie%20Library.jar!/resources/properties/movie_library.properties
  </code></pre>
  
  <p>Any help is appreciable. Thanks in advance.  </p>