private static void writeStatusToFile(final String jsonContent, final File directory,
      final ProcessType processType) throws IOException {
    File statusFile = new File(directory, processType.getStatusFileName());
    File statusFileTmp = new File(directory, processType.getStatusFileName() + ".tmp");

    deleteFileWithValidation(statusFile, "statusFile");
    deleteFileWithValidation(statusFileTmp, "statusFileTmp");

    if (!statusFileTmp.createNewFile()) {
      throw new IOException(
          "Unable to create statusFileTmp '" + statusFileTmp.getCanonicalPath() + "'");
    }

    try (FileWriter writer = new FileWriter(statusFileTmp)) {
      writer.write(jsonContent);
      writer.flush();
    }

    if (!statusFileTmp.renameTo(statusFile)) {
      throw new IOException("Unable to rename statusFileTmp '" + statusFileTmp.getCanonicalPath()
          + "' to '" + statusFile.getCanonicalPath() + "'");
    }
  }
Returns the PID file.

@return the PID file
geode-core/src/main/java/org/apache/geode/internal/process/FileControllableProcess.java