Package com.asakusafw.utils.io.csv

Examples of com.asakusafw.utils.io.csv.CsvReader


    }

    private List<List<String>> parse(String contents) {
        try {
            List<List<String>> results = new ArrayList<List<String>>();
            CsvReader reader = new CsvReader(new StringReader(contents));
            while (reader.next()) {
                results.add(reader.get());
            }
            return results;
        } catch (Exception e) {
            throw new AssertionError(e);
        }
View Full Code Here


                }
            } finally {
                sink.close();
            }

            CsvReader reader = new CsvReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
            try {
                Map<YaessJobId, List<String>> results = new HashMap<YaessJobId, List<String>>();
                assertThat("skip header", reader.next(), is(true));
                while (reader.next()) {
                    List<String> record = reader.get();
                    YaessJobId id = new YaessJobId();
                    id.setBatchId(record.get(0));
                    id.setFlowId(record.get(1));
                    id.setExecutionId(record.get(2));
                    id.setPhase(record.get(3));
                    id.setServiceId(record.get(4));
                    id.setJobId(record.get(5));
                    id.setTrackingId(record.get(6));
                    assertThat(results.get(id), is(nullValue()));
                    results.put(id, new ArrayList<String>(record.subList(7, record.size())));
                }
                return results;
            } finally {
                reader.close();
            }
        } catch (Exception e) {
            throw new AssertionError(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.utils.io.csv.CsvReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.