title: Reading a file from a relative path
body: <p>I know this question has been asked like 1000 times before. I did tried all the solutions(<a href="https://stackoverflow.com/questions/3844307/how-to-read-text-file-from-relative-path-in-a-project][this">How to read file from relative path in Java project? java.io.File cannot find the path specified</a> did not worked also), however none of them seems to be working.</p>
  
  <p>I am trying to read a image file by providing a relative path like this:</p>
  
  <pre><code>BufferedImage image;
  image = fm.readMap("..\\..\\resources\\5x5.png");
  </code></pre>
  
  <p>Reading:</p>
  
  <pre><code>public BufferedImage readMap(String path)
  {
      BufferedImage img = null;
      try{
          img = ImageIO.read(new File(path));
      }
      catch (IOException e){
          System.out.println("Image not found.");
          e.printStackTrace
      }
  
      return img;
  }
  </code></pre>
  
  <p>location of the code :</p>
  
  <p>parent --> src --> externalsourcemanagement --> TestMapAnalysis.java</p>
  
  <p>location of the image : parent --> resources --> 5x5.png</p>
  
  <p>Thanks in advance!</p>