cdm/src/main/java/ucar/nc2/NetcdfFile.java
public void empty() {
    if (immutable) throw new IllegalStateException("Cant modify");
    variables = new ArrayList<>();
    gattributes = new ArrayList<>();
    dimensions = new ArrayList<>();
    rootGroup = makeRootGroup();
    // addedRecordStructure = false;
  }
public void empty() {
    if (immutable) throw new IllegalStateException("Cant modify");
    variables = new ArrayList<>();
    gattributes = new ArrayList<>();
    dimensions = new ArrayList<>();
    rootGroup = makeRootGroup();
    // addedRecordStructure = false;
  }
Completely empty the objects in the netcdf file.
Used for rereading the file on a sync().