title: Java: Can't read a file in my project directory?
body: <p>I'm building a Vaadin(basically Java that compiles to html/javascript) project and am trying to import a template(basically a HTML file). For all intents and purposes thought, I'm just importing a file as an input stream. Here is the offending code: </p>
  
  <pre><code>File file = new File("C:/JavaProjects/VaadinSpikeWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/CISTVaadinClient/VAADIN/themes/layoutsinteractionDetailsTabLayout.html");
  InputStream is = null;
  CustomLayout custom = null;
  try {
      is = new FileInputStream(file);
  } catch (FileNotFoundException e1) {
      System.out.println("mark 1");
      e.printStackTrace();
  }
  
  try {
      custom = new CustomLayout(is);
  } catch (IOException e) {
      System.out.println("mark 2");
  e.printStackTrace(); 
  }
  </code></pre>
  
  <p>What I'm doing: </p>
  
  <ul>
  <li>Deploying the Vaadin project (basically a dynamic web project with a few extra .jars) to tomcat and accessing thVe aadin Project using my browser</li>
  </ul>
  
  <p>What I'm seeing: </p>
  
  <ul>
  <li>A blank screen in my browser</li>
  <li>File not found exception (i.e "mark 1") </li>
  <li>And as a result: IOException (i.e. "Mark 2") </li>
  </ul>
  
  <p>What I've checked: </p>
  
  <ul>
  <li>The file definitely does deploy to tomcat with the rest of the project</li>
  <li>Outside of the webapps folder, the file i'm trying to import is available via the browser once deployed (i.e. Localhost/myProject/MyFile.html) </li>
  <li>The Tomcat install is fine (It was a fresh install and works with this/other projects outside of this problem) </li>
  </ul>
  
  <p>What I've tried</p>
  
  <ul>
  <li>Using a relative URL, or just the name of the file (i.e. New File( "../webapps/vaadin/layouts/MyFile.html") )</li>
  <li>Using the absolute Path to the Project directory</li>
  <li>Using the absolute path to the deploy directory (as above) </li>
  <li>Putting the file somewhere else (read: Every single possible location in the project) </li>
  </ul>
  
  <p>Again, I'm trying to simply read the file, MyFile.html as an input stream. What am I doing wrong/ overlooking? </p>
  
  <p>Thanks for your time. </p>