grib/src/main/java/ucar/nc2/grib/GribIndexCache.java
public static File getExistingFileOrCache(String fileLocation) {
    File result =  getDiskCache2().getExistingFileOrCache(fileLocation);
    if (result == null && Grib.debugGbxIndexOnly && fileLocation.endsWith(".gbx9.ncx4")) { // might create only from gbx9 for debugging
      int length = fileLocation.length();
      String maybeIndexAlreadyExists = fileLocation.substring(0, length-10)+".ncx4";
      result =  getDiskCache2().getExistingFileOrCache(maybeIndexAlreadyExists);
    }
    return result;
  }
public static File getExistingFileOrCache(String fileLocation) {
    File result =  getDiskCache2().getExistingFileOrCache(fileLocation);
    if (result == null && Grib.debugGbxIndexOnly && fileLocation.endsWith(".gbx9.ncx4")) { // might create only from gbx9 for debugging
      int length = fileLocation.length();
      String maybeIndexAlreadyExists = fileLocation.substring(0, length-10)+".ncx4";
      result =  getDiskCache2().getExistingFileOrCache(maybeIndexAlreadyExists);
    }
    return result;
  }
public static File getExistingFileOrCache ( String fileLocation ) { File result = getDiskCache2 ( ) . getExistingFileOrCache ( fileLocation ) ; if ( result == null && Grib . debugGbxIndexOnly && fileLocation . endsWith ( ".gbx9.ncx4" ) ) { // might create only from gbx9 for debugging int length = fileLocation . length ( ) ; String maybeIndexAlreadyExists = fileLocation . substring ( 0 , length - 10 ) + ".ncx4" ; result = getDiskCache2 ( ) . getExistingFileOrCache ( maybeIndexAlreadyExists ) ; } return result ; }
Looking for an existing file, in cache or not

@param fileLocation full path of original index filename
@return existing file if you can find it, else null
Looking for an existing file in cache or not