cdm/src/main/java/ucar/nc2/NetcdfFile.java
public synchronized void close() throws java.io.IOException {
    if (cache != null) {
      if (cache.release(this))
        return;
    }

    try {
      if (null != spi) {
        // log.warn("NetcdfFile.close called for ncfile="+this.hashCode()+" for iosp="+spi.hashCode());
        spi.close();
      }
    } finally {
      spi = null;
    }
  }
public synchronized void close() throws java.io.IOException {
    if (cache != null) {
      if (cache.release(this))
        return;
    }

    try {
      if (null != spi) {
        // log.warn("NetcdfFile.close called for ncfile="+this.hashCode()+" for iosp="+spi.hashCode());
        spi.close();
      }
    } finally {
      spi = null;
    }
  }
Close all resources (files, sockets, etc) associated with this file.
If the underlying file was acquired, it will be released, otherwise closed.
if isClosed() already, nothing will happen

@throws java.io.IOException if error when closing