grib/src/main/java/ucar/nc2/grib/collection/GribCdmIndex.java
@Override
  public boolean readChildren(Path indexFile, AddChildCallback callback) throws IOException {
    logger.debug("GribCdmIndex.readChildren %s%n", indexFile);
    try (RandomAccessFile raf = RandomAccessFile.acquire(indexFile.toString())) {
      GribCollectionType type = getType(raf);
      if (type == GribCollectionType.Partition1 || type == GribCollectionType.Partition2) {
        if (openIndex(raf, logger)) {
          String topDir = gribCollectionIndex.getTopDir();
          int n = gribCollectionIndex.getMfilesCount(); // partition index files stored in MFiles
          for (int i = 0; i < n; i++) {
            GribCollectionProto.MFile mfilep = gribCollectionIndex.getMfiles(i);
            callback.addChild(topDir, mfilep.getFilename(), mfilep.getLastModified());
          }
          return true;
        }
      }
      return false;
    }
  }
@Override
  public boolean readChildren(Path indexFile, AddChildCallback callback) throws IOException {
    logger.debug("GribCdmIndex.readChildren %s%n", indexFile);
    try (RandomAccessFile raf = RandomAccessFile.acquire(indexFile.toString())) {
      GribCollectionType type = getType(raf);
      if (type == GribCollectionType.Partition1 || type == GribCollectionType.Partition2) {
        if (openIndex(raf, logger)) {
          String topDir = gribCollectionIndex.getTopDir();
          int n = gribCollectionIndex.getMfilesCount(); // partition index files stored in MFiles
          for (int i = 0; i < n; i++) {
            GribCollectionProto.MFile mfilep = gribCollectionIndex.getMfiles(i);
            callback.addChild(topDir, mfilep.getFilename(), mfilep.getLastModified());
          }
          return true;
        }
      }
      return false;
    }
  }
@ Override public boolean readChildren ( Path indexFile , AddChildCallback callback ) throws IOException { logger . debug ( "GribCdmIndex.readChildren %s%n" , indexFile ) ; try ( RandomAccessFile raf = RandomAccessFile . acquire ( indexFile . toString ( ) ) ) { GribCollectionType type = getType ( raf ) ; if ( type == GribCollectionType . Partition1 || type == GribCollectionType . Partition2 ) { if ( openIndex ( raf , logger ) ) { String topDir = gribCollectionIndex . getTopDir ( ) ; int n = gribCollectionIndex . getMfilesCount ( ) ; // partition index files stored in MFiles for ( int i = 0 ; i < n ; i ++ ) { GribCollectionProto . MFile mfilep = gribCollectionIndex . getMfiles ( i ) ; callback . addChild ( topDir , mfilep . getFilename ( ) , mfilep . getLastModified ( ) ) ; } return true ; } } return false ; } }
/ IndexReader interface
/ IndexReader interface