package nxm.webvnc.lib;

import nxm.sys.net.HFiles;

/**
 * Serve a directory as a web page.
 *
 * @author adw
 * @since NeXtMidas 4.1.1
 *
 */
public class RootHFiles extends HFiles {

  /** Constructor
   *
   *  @param dirpath  path on disk to the files that should be served at the root URL
   */
  public RootHFiles (String dirpath) {
    super("", dirpath);
    this.name = "";
  }

  /** Overrides the canHandleRequest method in {@link HFiles}
   *
   *  @return true if there is no instance of the character "?" in the uri, as this would indicate a RESTful request
   *
   */
  @Override
  public boolean canHandleRequest (String uri) {
    return uri.indexOf("?") == -1;
  }

}
