title: Property file is returning as null in Java
body: <p>I am trying to read some property from the properties file, but my code is not reading the property file. The properties file is in some folder in my machine.</p>
  
  <p>Here is my code: </p>
  
  <pre><code>public String getproperty(){
  
      String extension="";
      Properties  prop = new Properties ();
      String propname = "\\"+Any location in your machine+"\\fileExtension.properties";
      Logger.debug("ReadFiles", " ----Property file path---- "+ propname, null);
      ip = getClass().getClassLoader().getResourceAsStream(propname);
      Logger.debug("ReadFiles", " ----ip value ---- "+ip, null);
          try {
              if(ip != null){
                  prop.load(ip);
                  Logger.debug("ReadFiles", " ----Property file loaded---- ", null);
              }
  
              extension = prop.getProperty("fileExt");
              Logger.debug("ReadFiles", " ----Property =  " + extension, null);
  
          } catch (IOException e) {
              Logger.error("ReadFiles", " ----Error while loading property file---- ", null);
              e.printStackTrace();
          }
          finally{
              try {
                  ip.close();
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return extension;
  }
  </code></pre>
  
  <p>I am creating a jar placing it in lib folder of server (installed in my machine) and placing the properties file in my machine and given the same path in code. I have tried with absolute path and without absolute path.</p>