protected CollectionAbstract(String collectionName, org.slf4j.Logger logger) { this.collectionName = cleanName(collectionName); this.logger = logger != null ? logger : defaultLog; }
@Override public MFile getLatestFile() throws IOException { MFile result = null; for (MFile f : getFilesSorted()) // only have an Iterable result = f; return result; }
@Override public String getIndexFilename() { return getRoot() + "/" + collectionName + NCX_SUFFIX; }
protected List<MFile> makeFileListSorted() throws IOException { List<MFile> list = new ArrayList<>(100); try (CloseableIterator<MFile> iter = getFileIterator()) { if (iter == null) return list; while (iter.hasNext()) list.add(iter.next()); } if (hasDateExtractor()) { Collections.sort(list, new DateSorter()); // sort by date } else { Collections.sort(list); // sort by name } return list; }
private CalendarDate extractRunDateWithError(MFile mfile) { CalendarDate result = extractDate(mfile); if (result == null) logger.error("Failed to extract date from file {} with Extractor {}", mfile.getPath(), dateExtractor); return result; }
@Override public String getIndexFilename(String suffix) { if (isTop) return super.getIndexFilename(suffix); Path indexPath = DirectoryCollection.makeCollectionIndexPath(topCollection, collectionDir, suffix); return indexPath.toString(); }
public int compare(MFile m1, MFile m2) { CalendarDate cd1 = extractRunDateWithError(m1); CalendarDate cd2 = extractRunDateWithError(m2); if ((cd1 == null) || (cd2 == null)) { //cd1 = extractRunDateWithError(m1); //debug //cd2 = extractRunDateWithError(m2); throw new IllegalStateException(); } return cd1.compareTo(cd2); } }
protected List<MFile> makeFileListSorted() throws IOException { List<MFile> list = new ArrayList<>(100); try (CloseableIterator<MFile> iter = getFileIterator()) { while (iter.hasNext()) { list.add(iter.next()); } } if (hasDateExtractor()) { Collections.sort(list, new DateSorter()); // sort by date } else { Collections.sort(list); // sort by name } return list; }
CalendarDate extractRunDateWithError(MFile mfile) { CalendarDate result = extractDate(mfile); if (result == null) logger.error("Failed to extract date from file {} with Extractor {}", mfile.getPath(), dateExtractor); return result; }
@Override public String getIndexFilename(String suffix) { if (isTop) return super.getIndexFilename(suffix); Path indexPath = DirectoryCollection.makeCollectionIndexPath(topCollection, collectionDir, suffix); return indexPath.toString(); }
protected CollectionAbstract(String collectionName, org.slf4j.Logger logger) { this.collectionName = cleanName(collectionName); this.logger = logger != null ? logger : defaultLog; }
@Override public MFile getLatestFile() throws IOException { MFile result = null; for (MFile f : getFilesSorted()) // only have an Iterable result = f; return result; }
@Override public String getIndexFilename(String suffix) { return getRoot() + "/" + collectionName + suffix; }
protected InvDatasetFeatureCollection(InvDatasetImpl parent, String name, String path, FeatureCollectionType fcType, FeatureCollectionConfig config) { super(parent, name, buildCatalogServiceHref(path)); this.path = path; this.fcType = fcType; this.config = config; this.getLocalMetadataInheritable().setDataType(fcType.getFeatureType()); this.collectionName = CollectionAbstract.cleanName(config.name != null ? config.name : name); config.name = collectionName; this.logger = loggerFactory.getLogger("fc." + collectionName); // seperate log file for each feature collection (!!) this.logger.info("FeatureCollection added = {}", getConfig()); }
@Override public List<String> getFilenames() throws IOException { List<String> result = new ArrayList<>(); for (MFile f : getFilesSorted()) result.add(f.getPath()); return result; }
collectionName = CollectionAbstract.cleanName(collectionName != null ? collectionName : name);
@Override public List<String> getFilenames() throws IOException { List<String> result = new ArrayList<>(); for (MFile f : getFilesSorted()) result.add(f.getPath()); return result; }
collectionName = CollectionAbstract.cleanName(collectionName != null ? collectionName : name);