code: static long readCheckpointTime(StorageDirectory sd) throws IOException {
      File timeFile = NNStorage.getStorageFile(sd, NameNodeFile.TIME);
      long timeStamp = 0L;
      if (timeFile.exists() && timeFile.canRead()) {
        DataInputStream in = new DataInputStream(new FileInputStream(timeFile));
        try {
          timeStamp = in.readLong();
        } finally {
          IOUtils.cleanup(LOG, in);
        }
      }
      return timeStamp;
    }
docs: Determine the checkpoint time of the specified StorageDirectory
  
  @param sd StorageDirectory to check
  @return If file exists and can be read, last checkpoint time. If not, 0L.
  @throws IOException On errors processing file pointed to by sd