@OnEnabled public void onEnabled(final ConfigurationContext context) throws InitializationException, IOException { this.csvFile = context.getProperty(CSV_FILE).evaluateAttributeExpressions().getValue(); this.csvFormat = CSVFormat.Predefined.valueOf(context.getProperty(CSV_FORMAT).getValue()).getFormat(); this.charset = context.getProperty(CHARSET).evaluateAttributeExpressions().getValue(); this.lookupKeyColumn = context.getProperty(LOOKUP_KEY_COLUMN).evaluateAttributeExpressions().getValue(); this.ignoreDuplicates = context.getProperty(IGNORE_DUPLICATES).asBoolean(); this.watcher = new SynchronousFileWatcher(Paths.get(csvFile), new LastModifiedMonitor(), 30000L); try { loadCache(); } catch (final IllegalStateException e) { throw new InitializationException(e.getMessage(), e); } }
public void initOptionSpecs() { //OptionParser optionParser) { predefinedFormats = Arrays.asList(CSVFormat.Predefined.values()).stream() .map(Enum::name) .collect(Collectors.toMap(
public void initOptionSpecs() { //OptionParser optionParser) { predefinedFormats = Arrays.asList(CSVFormat.Predefined.values()).stream() .map(Enum::name) .collect(Collectors.toMap(
public void setFormat(final CSVFormat.Predefined predefined) { this.format = predefined.name(); }
@Override public void setFromArgs(Namespace args) throws CommandLineParsingException { super.setFromArgs(args); csv = args.getString("input"); format = ((CSVFormat.Predefined) args.get("type")).getFormat(); chr = args.getInt("chr") - 1; pos = args.getInt("pos") - 1; ref = args.getInt("ref") - 1; alt = args.getInt("alt") - 1; header = args.getBoolean("header"); if ( header) format = format.withFirstRecordAsHeader().withSkipHeaderRecord(); }
public void setFormat(final CSVFormat.Predefined predefined) { this.format = predefined.name(); }
@OnEnabled public void onEnabled(final ConfigurationContext context) throws InitializationException, IOException, FileNotFoundException { this.csvFile = context.getProperty(CSV_FILE).evaluateAttributeExpressions().getValue(); this.csvFormat = CSVFormat.Predefined.valueOf(context.getProperty(CSV_FORMAT).getValue()).getFormat(); this.charset = context.getProperty(CHARSET).evaluateAttributeExpressions().getValue(); this.lookupKeyColumn = context.getProperty(LOOKUP_KEY_COLUMN).evaluateAttributeExpressions().getValue(); this.lookupValueColumn = context.getProperty(LOOKUP_VALUE_COLUMN).evaluateAttributeExpressions().getValue(); this.ignoreDuplicates = context.getProperty(IGNORE_DUPLICATES).asBoolean(); this.watcher = new SynchronousFileWatcher(Paths.get(csvFile), new LastModifiedMonitor(), 30000L); try { loadCache(); } catch (final IllegalStateException e) { throw new InitializationException(e.getMessage(), e); } }