title: getResourceAsStream() is returning null. Properties file is not loading
body: <p>I am trying to load properties file. Here is my structure</p>
  
  <p><img src="https://i.stack.imgur.com/BzrUN.png" alt="Directory Structure"></p>
  
  <p>Now i am trying to load test.properties file. But i am getting null. Here how i am doing</p>
  
  <pre><code>public class Test {
  
      String workingDir = System.getProperty("user.dir");
      System.out.println("Current working directory : " + workingDir);
  
      File temp = new File(workingDir + "\\" + "test.properties");
      String absolutePath = temp.getAbsolutePath();
      System.out.println("File path : " + absolutePath);
  
      Properties properties = null;
  
      try {
          properties = new Properties();
          InputStream resourceAsStream =  Test.class.getClassLoader().getResourceAsStream(absolutePath);
          if (resourceAsStream != null) {
              properties.load(resourceAsStream);
          }
  
  
      } catch (IOException e) {
          e.printStackTrace();
      }
  
      System.exit(0);
  
  } //end of class Test
  </code></pre>
  
  <p>This program prints</p>
  
  <pre><code>Current working directory : D:\Personal Work\eclipse 32 Bit\workspace\Spring Integration\LS360BatchImportIntegration
  File path : D:\Personal Work\eclipse 32 Bit\workspace\Spring Integration\LS360BatchImportIntegration\test.properties
  </code></pre>
  
  <p>But it is not loading properties file from this path. Although it is present there. Why i am getting null ?</p>
  
  <p>Thanks</p>
  
  <p><strong>Edit---
  ----------------------------</strong></p>
  
  <pre><code>String workingDir = System.getProperty("user.dir");
  System.out.println("Current working directory : " + workingDir);
  
  File temp = new File(workingDir, "test.properties");
  
  String absolutePath = temp.getAbsolutePath();
  System.out.println("File path : " + absolutePath);
  
  try {
      properties = new Properties();
      InputStream resourceAsStream =  new FileInputStream(temp);
      if (resourceAsStream != null) {
          properties.load(resourceAsStream);
      }   
  } catch (IOException e) {
      e.printStackTrace();
  }
  
  System.exit(0);
  
  Current working directory : D:\Personal Work\eclipse 32 Bit\workspace\Spring Integration\LS360BatchImportIntegration
  File path : D:\Personal Work\eclipse 32 Bit\workspace\Spring Integration\LS360BatchImportIntegration\test.properties
  java.io.FileNotFoundException: D:\Personal Work\eclipse 32 Bit\workspace\Spring Integration\LS360BatchImportIntegration\test.properties (The system cannot find the file specified)
  at java.io.FileInputStream.open(Native Method)
  at java.io.FileInputStream.&lt;init&gt;(Unknown Source)
  at com.softech.ls360.integration.BatchImport.main(BatchImport.java:57)
  </code></pre>