/** * Manage collections of files that we can assign date ranges to * * @param manager the collection manager * @param errlog put error messsages here * @see CollectionSpecParser * @throws java.io.IOException on read error */ public TimedCollection(CollectionManager manager, Formatter errlog) throws IOException { this.manager = manager; // get the inventory, sorted by path manager.scanIfNeeded(); update(); if (debug) { System.out.printf("Datasets in collection=%s%n", manager.getCollectionName()); for (TimedCollection.Dataset d: datasets) { System.out.printf(" %s %n",d); } System.out.printf("%n"); } }
/** * Manage collections of files that we can assign date ranges to * * @param manager the collection manager * @param errlog put error messsages here * @see CollectionSpecParser * @throws java.io.IOException on read error */ public TimedCollection(MCollection manager, Formatter errlog) throws IOException { this.manager = manager; // get the inventory, sorted by path if (manager instanceof CollectionManager) { ((CollectionManager)manager).scanIfNeeded(); } update(); if (debug) { System.out.printf("Datasets in collection=%s%n", manager.getCollectionName()); for (TimedCollection.Dataset d: datasets) { System.out.printf(" %s %n",d); } System.out.printf("%n"); } }
@Override protected State checkState() throws IOException { synchronized (lock) { if (state == null) { firstInit(); } else if (!dcm.scanIfNeeded()) { // perform new scan if needed, return false if no change return state; } // copy on write State localState = new State(state); makeDatasets(localState); // LOOK whats really needed is just the time range metadata updated update(CollectionManager.Force.test); if (null != fd) { localState.vars = MetadataExtractor.extractVariables(fd); localState.coverage = MetadataExtractor.extractGeospatial(fd); localState.dateRange = MetadataExtractor.extractCalendarDateRange(fd); } state = localState; return state; } }