code: public static boolean isJobDirValid(Path jobDirPath, FileSystem fs)
    throws IOException {
      FileStatus[] contents = fs.listStatus(jobDirPath);
      int matchCount = 0;
      if (contents != null && contents.length >=2) {
        for (FileStatus status : contents) {
          if ("job.xml".equals(status.getPath().getName())) {
            ++matchCount;
          }
          if ("job.split".equals(status.getPath().getName())) {
            ++matchCount;
          }
        }
        if (matchCount == 2) {
          return true;
        }
      }
      return false;
    }
docs: Checks if the job directory is clean and has all the required components
  for (re) starting the job