title: Resource file not found in Java program
body: <p>I have tried every path that I could and it is unable to find the file path.</p>
  
  <pre><code>public class JobOrderGenerator {
  
      private File file = new File("/resources/Shop-Order.xlsx");
      private int sheetNumber = 0;
  
      public JobOrderGenerator(List&lt;ShopOrder&gt; shopOrder) throws InvalidFormatException, IOException {
  
          for (ShopOrder shopOrder1 : shopOrder) {
  
              writeToSpecificCell(2, 1, sheetNumber, shopOrder1.getPo_number()); //Po Number
              writeToSpecificCell(7, 3, sheetNumber, shopOrder1.getPo_number()); //Part Number
              LocalDate date = shopOrder1.getPo_due_date();
              String dateToString = date.toString();
              writeToSpecificCell(1, 2, sheetNumber, dateToString); //Due_Date
              writeToSpecificCell(7, 5, sheetNumber, Integer.toString(shopOrder1.getPart_quantity())); //Quantity
              //writeToSpecificCell(1,2,sheetNumber, shopOrder.get); //Material
              writeToSpecificCell(8, 3, sheetNumber, shopOrder1.getPart_decription()); //Part Description
              //writeToSpecificCell(1,2,sheetNumber, shopOrder.getCustomer()); //Customer
              writeToSpecificCell(10, 1, sheetNumber, shopOrder1.getMachine_number()); //Machine
  
              sheetNumber++;
  
          }
      }
  
      void writeToSpecificCell(int rowNumber, int cellNumber, int sheetNumber, String value) throws InvalidFormatException, IOException {
  
          if(file.exists()){
              System.out.println("Was was found");
          } else {
              System.out.println("File was NOT found");
          }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/czRta.png" alt="File is in the resources folder"></p>
  
  <p>Whenever I run the program the else statement runs saying </p>
  
  <p>"File was NOT found"</p>
  
  <p>Advice?</p>