private void readMetaData(File f, FetchedDocument doc) {
    try {
      InputStreamReader is = new InputStreamReader(new FileInputStream(f), "UTF-8");
      BufferedReader reader = new BufferedReader(is);
      Map<String, String> metadata = new HashMap<String, String>();
      String line = null;
      while ((line = reader.readLine()) != null) {
        if (line.length() == 0) {
          continue;
        }

        String[] values = line.split(":", 2);
        String key = values[0];
        String value = values[1];
        if ("url".equalsIgnoreCase(key)) {
          doc.setDocumentURL(value);
        } else if ("host".equalsIgnoreCase(key)) {
          // skip, do nothing
        } else if ("Content-Type".equalsIgnoreCase(key)) {
          doc.setContentType(value);
        } else if ("Charset".equalsIgnoreCase(key)) {
          doc.setContentCharset(value);
        } else {
          metadata.put(key, value);
        }
      }
      reader.close();
      doc.setDocumentMetadata(metadata);
    } catch (IOException e) {
      throw new RuntimeException(
          "Error while reading metadata from file: '" + f.getAbsolutePath() + "'", e);
    }
  }