title: Vertx - Simple web server doesn't find the html file
body: <p>I'm trying to write a simple webserver that'd server a html file from the local file system using vertx in java. For some reason the below code doesn't find the file although I have my web/index.html in the resources folder. I'm using IntelliJ and it copies over this folder to the classes folder that it generates for the project. If I give the absolute path it works as expected. What am I doing wrong or how can I figure out whether 'web' folder is a part of the classpath? Btw, I have tested by running this from IntelliJ as well as from the terminal using "mvn exec:java -Dexec.mainClass="test.vertx.VertxDriver" but get the same result - Resource not found.</p>
  
  <pre><code>package test.vertx;
  
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  import org.vertx.java.core.*;
  import org.vertx.java.core.http.HttpServer;
  import org.vertx.java.core.http.HttpServerRequest;
  
  import java.io.IOException;
  
  public class VertxDriver {
      private static final Logger logger = LoggerFactory.getLogger(VertxDriver.class);
  
      public static void main(String[] args) {
          VertxDriver driver = new VertxDriver();
  
          Vertx vertx = VertxFactory.newVertx();
          HttpServer httpServer = vertx.createHttpServer();
          httpServer.requestHandler(driver.new FileRequestHandler(vertx));
  
          httpServer.listen(9999,"localhost");
  
          try {
              System.in.read();
          } catch (IOException e) {
              e.printStackTrace();
          }
      }
  
      class FileRequestHandler implements Handler&lt;HttpServerRequest&gt; {
          private Vertx vertx;
  
          FileRequestHandler(Vertx vertx) {this.vertx = vertx;}
  
          @Override
          public void handle(HttpServerRequest httpServerRequest) {
              String file = "";
              if(httpServerRequest.path().equals("/")) {
                  file = "index.html";
              }
              logger.info("File being served is: "+file);
              httpServerRequest.response().sendFile("web/"+file);
          }
      }
  }
  </code></pre>