cdm/src/main/java/ucar/nc2/dataset/NetcdfDataset.java
static public NetcdfFile acquireFile(ucar.nc2.util.cache.FileFactory factory, Object hashKey,
                                       DatasetUrl location, int buffer_size, ucar.nc2.util.CancelTask cancelTask, Object spiObject) throws IOException {

    // must use the factory if there is one but no fileCache
    if ((netcdfFileCache == null) && (factory != null)) {
      return (NetcdfFile) factory.open(location, buffer_size, cancelTask, spiObject);
    }

    return openOrAcquireFile(netcdfFileCache, factory, hashKey, location, buffer_size, cancelTask, spiObject);
  }
static public NetcdfFile acquireFile(ucar.nc2.util.cache.FileFactory factory, Object hashKey,
                                       DatasetUrl location, int buffer_size, ucar.nc2.util.CancelTask cancelTask, Object spiObject) throws IOException {

    // must use the factory if there is one but no fileCache
    if ((netcdfFileCache == null) && (factory != null)) {
      return (NetcdfFile) factory.open(location, buffer_size, cancelTask, spiObject);
    }

    return openOrAcquireFile(netcdfFileCache, factory, hashKey, location, buffer_size, cancelTask, spiObject);
  }
static public NetcdfFile acquireFile ( ucar . nc2 . util . cache . FileFactory factory , Object hashKey , DatasetUrl location , int buffer_size , ucar . nc2 . util . CancelTask cancelTask , Object spiObject ) throws IOException { // must use the factory if there is one but no fileCache if ( ( netcdfFileCache == null ) && ( factory != null ) ) { return ( NetcdfFile ) factory . open ( location , buffer_size , cancelTask , spiObject ) ; } return openOrAcquireFile ( netcdfFileCache , factory , hashKey , location , buffer_size , cancelTask , spiObject ) ; }
Same as openFile, but file is acquired through the File Cache.
You still close with NetcdfFile.close(), the release is handled automatically.
You must first call initNetcdfFileCache() for caching to actually take place.

@param factory     if not null, use this factory to read the file. If null, use the default factory.
@param hashKey     if not null, use as the cache key, else use the location
@param location    location of file, passed to FileFactory
@param buffer_size RandomAccessFile buffer size, if <= 0, use default size
@param cancelTask  allow task to be cancelled; may be null.
@param spiObject   sent to iosp.setSpecial(); may be null
@return NetcdfFile object
@throws java.io.IOException on read error
Same as openFile but file is acquired through the File Cache . You still close with NetcdfFile . close () the release is handled automatically . You must first call initNetcdfFileCache () for caching to actually take place .