/** * @see stream.lookup.AbstractDatabase#populateDatabase(stream.io.SourceURL, * java.util.Map) */ @Override protected void populateDatabase(SourceURL url, Map<String, Data> database) throws Exception { CsvStream stream = new CsvStream(url); stream.setHeader(isHeader()); stream.setKeys(getKeys()); stream.setSeparator(getSeparator()); stream.init(); readDatabase(stream, database); stream.close(); }
/** * @see stream.service.Service#reset() */ @Override public void reset() throws Exception { log.debug("Reading graph from {}", file); CsvStream stream = new CsvStream(new FileInputStream(file)); Data item = stream.read(); while (item != null) { Serializable start = item.get("start"); Serializable end = item.get("end"); if (start != null && end != null) { addEdge(start.toString(), end.toString()); } else { throw new Exception( "Failed to extract start/end from data item: " + item + "!"); } item = stream.read(); } stream.close(); }
String line = readLine(); if (line == null) return null; line = readLine(); value = removeQuotes(tok[i]); value = removeQuotes(tok[i]);
String fmt = url.toString(); if (fmt.endsWith(".csv") || fmt.endsWith(".csv.gz")) { stream = new CsvStream(new SourceURL(url));
String line = readLine(); if (line == null) return null; line = readLine(); value = removeQuotes(tok[i]); value = removeQuotes(tok[i]);
String fmt = url.toString(); if (fmt.endsWith(".csv") || fmt.endsWith(".csv.gz")) { stream = new CsvStream(new SourceURL(url));
/** * @see stream.lookup.AbstractDatabase#populateDatabase(stream.io.SourceURL, * java.util.Map) */ @Override protected void populateDatabase(SourceURL url, Map<String, Data> database) throws Exception { CsvStream stream = new CsvStream(url); stream.setHeader(isHeader()); stream.setKeys(getKeys()); stream.setSeparator(getSeparator()); stream.init(); readDatabase(stream, database); stream.close(); }
String line = readLine(); if (line == null) return null; line = readLine(); value = removeQuotes(tok[i]); value = removeQuotes(tok[i]);
String fmt = url.toString(); if (fmt.endsWith(".csv") || fmt.endsWith(".csv.gz")) { stream = new CsvStream(new SourceURL(url));
/** * @see stream.lookup.AbstractDatabase#populateDatabase(stream.io.SourceURL, * java.util.Map) */ @Override protected void populateDatabase(SourceURL url, Map<String, Data> database) throws Exception { CsvStream stream = new CsvStream(url); stream.setHeader(isHeader()); stream.setKeys(getKeys()); stream.setSeparator(getSeparator()); stream.init(); readDatabase(stream, database); stream.close(); }