/** * Get the location of this Dataset * * @return the location of this Dataset */ public String getLocation() { return (mfile == null) ? cacheLocation : mfile.getPath(); }
@Override public String getIndexFilename() { return mfiles.get(0).getPath(); } }
@Override public String getIndexFilename(String suffix) { return mfiles.get(0).getPath(); } }
@Override public void setFiles(Iterable<MFile> files) { Map<String, MFile> newMap = new HashMap<String, MFile>(); for (MFile file : files) newMap.put(file.getPath(), file); synchronized (this) { map = newMap; this.lastScanned = System.currentTimeMillis(); this.lastChanged.set(this.lastScanned); } }
public List<String> getFilenames() { List<String> result = new ArrayList<>(); if (filenose == null) return result; for (int fileno : filenose) result.add(fileMap.get(fileno).getPath()); Collections.sort(result); return result; }
public void setFiles(Iterable<MFile> files) { Map<String, MFile> newMap = new HashMap<>(); for (MFile file : files) newMap.put(file.getPath(), file); synchronized (this) { map = newMap; this.lastScanned = System.currentTimeMillis(); this.lastChanged.set(this.lastScanned); } }
public void setFiles(Iterable<MFile> files) { Map<String, MFile> newMap = new HashMap<>(); for (MFile file : files) newMap.put(file.getPath(), file); synchronized (this) { map = newMap; this.lastScanned = System.currentTimeMillis(); this.lastChanged.set(this.lastScanned); } }
private CalendarDate extractRunDateWithError(MFile mfile) { CalendarDate result = extractRunDate(mfile); if (result == null) logger.error("Failed to extract date from file {} with Extractor {}", mfile.getPath(), dateExtractor); return result; }
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; }
public String getId() { if (id != null) return id; if (mfile != null) return mfile.getPath(); return Integer.toString(this.hashCode()); }
@Override public CrawlableDataset getParentDataset() { String path = mfile.getPath(); int pos = path.lastIndexOf("/"); return new CrawlableMFile(controller, path.substring(0,pos)); }
public String getId() { if (id != null) return id; if (mfile != null) return mfile.getPath(); return Integer.toString(this.hashCode()); }
protected Dataset(MFile mfile) { this.mfile = mfile; this.cacheLocation = mfile.getPath(); this.enhance = (Set<NetcdfDataset.Enhance>) mfile.getAuxInfo(); }
public List<String> getFilenames() { List<String> result = new ArrayList<String>(); for (MFile f: getFiles()) result.add(f.getPath()); return result; }
public CollectionSingleFile(MFile file, org.slf4j.Logger logger) { super(file.getName(), logger); mfiles.add(file); Path p = Paths.get(file.getPath()); if (p.getParent() != null) this.root = p.getParent().toString(); else this.root = System.getProperty("user.dir"); this.lastModified = file.getLastModified(); }
@Override public Date getDate(MFile mfile) { if (useName) return DateFromString.getDateUsingDemarkatedCount(mfile.getName(), dateFormatMark, '#'); else return DateFromString.getDateUsingDemarkatedMatch(mfile.getPath(), dateFormatMark, '#'); }
@Override public Date getDate(MFile mfile) { if (useName) return DateFromString.getDateUsingDemarkatedCount(mfile.getName(), dateFormatMark, '#'); else return DateFromString.getDateUsingDemarkatedMatch(mfile.getPath(), dateFormatMark, '#'); }
public static GribIndex open(boolean isGrib1, MFile mfile) throws IOException { GribIndex index = isGrib1 ? new Grib1Index() : new Grib2Index(); if (!index.readIndex(mfile.getPath(), mfile.getLastModified(), CollectionUpdateType.never)) { return null; } return index; }