code: public static String getElasticsearchPid(String baseDir)
      {
          try
          {
              String pid = new String(Files.readAllBytes(Paths.get(baseDir, "pid")));
              return pid;
          }
          catch (IOException e)
          {
              throw new IllegalStateException(
                      String.format(
                              "Cannot read the PID of the Elasticsearch process from the pid file in directory '%s'",
                              baseDir),
                      e);
          }
      }
docs: Read the ES PID from the pid file and return it.
  @param baseDir the base directory where the pid file is
  @return