public void load(String filename) {
    try {
      Properties prop = new Properties();
      prop.load(new FileInputStream(filename));
      try {
        setPort(Integer.parseInt(prop.getProperty("port", "80")));
      } catch (NumberFormatException e) {
        LOGGER.warning("Invalid value for \"port\" in \"" + filename + "\", proceeding with default value");
      }
      setDocRoot(prop.getProperty("docroot", "."));
      setListDir(prop.getProperty("listdir", "0").equals("1") || prop.getProperty("listdir", "false").toLowerCase().equals("true"));
      try {
        setMaxReq(Integer.parseInt(prop.getProperty("maxreq", "5")));
      } catch (NumberFormatException e) {
        LOGGER.warning("Invalid value for \"maxreq\" in \"" + filename + "\", proceeding with default value");
      }
    } catch (IOException e) {
      LOGGER.info("Creating \"" + filename + "\" with default values");
      save(filename);
    }
  }