code: public static String readFirstLine(String path) throws FileNotFoundException, IOException {
          try (FileInputStream fis = new FileInputStream(path)) {
              try (InputStreamReader isr = new InputStreamReader(fis)) {
                  try (BufferedReader br = new BufferedReader(isr)) {
                      return br.readLine();
                  }
              }
          }
      }
docs: Reads first line in the file specified by {@code path}.
  
  @param path Path to read.
  @return First line from the file.
  @throws FileNotFoundException File cannot be found.
  @throws IOException Error reading the file.