title: How to read my property in war correctly?
body: <p>I have a problem regarding reading my property, I do it like this:</p>
  <pre><code>    FileInputStream fis;
      Properties properties = new Properties(System.getProperties());
      fis = new FileInputStream(Objects.requireNonNull(this.getClass().getClassLoader()
              .getResource(&quot;config.properties&quot;)).getFile());
      properties.load(fis);
  </code></pre>
  <p>on the local machine, this works well, but when I deploy my application there is a problem:</p>
  <pre><code>Caused by: java.io.FileNotFoundException: /content/MyProject-1.0-SNAPSHOT.war/WEB-INF/classes/config.properties (No such file or directory)
  </code></pre>
  <p>When I try to see if there is a file I need, I find it, but java can't find it.</p>
  <p>Here is an approximate structure of my project:</p>
  <p>src/main/java/entities/PropertyInit.java - from here I try to read properties</p>
  <p>src/main/resources/config.properties  - here is the path to my property</p>