code: public static List<Checkpoint> availableCheckpoints(File directory){
          File checkpointRecordFile = new File(directory, "checkpointInfo.txt");
          Preconditions.checkState(checkpointRecordFile.exists(), "Could not find checkpoint record file at expected path %s", checkpointRecordFile.getAbsolutePath());
  
          List<String> lines;
          try(InputStream is = new BufferedInputStream(new FileInputStream(checkpointRecordFile))){
              lines = IOUtils.readLines(is);
          } catch (IOException e){
              throw new RuntimeException("Error loading checkpoint data from file: " + checkpointRecordFile.getAbsolutePath(), e);
          }
  
          List<Checkpoint> out = new ArrayList<>(lines.size()-1); //Assume first line is header
          for( int i=1; i<lines.size(); i++ ){
              Checkpoint c = Checkpoint.fromFileString(lines.get(i));
              if(new File(directory, c.getFilename()).exists()){
                  out.add(c);
              }
          }
          return out;
      }
docs: List all available checkpoints. A checkpoint is 'available' if the file can be loaded. Any checkpoint files that
  have been automatically deleted (given the configuration) will not be returned here.
  Note that the checkpointInfo.txt file must exist, as this stores checkpoint information
  
  @return List of checkpoint files that can be loaded from the specified directory