@Test(expected = ParseException.class) public void parse_NO_PATH_VALUE() throws ParseException { cmdLineOptionsParser.parse(new String[] {"-path"}); }
public String parse(String[] args) throws ParseException { CommandLineParser clParser = new DefaultParser(); commandLine = clParser.parse(options, args); if (commandLine.getOptionValue("path") == null) { return "\"path\" parameter not specified"; } String output = commandLine.getOptionValue("outputs"); String exts = commandLine.getOptionValue("exts"); if (output != null) { List<String> outputs = Lists.newArrayList(output.split(",")); outputs.removeAll(Lists.newArrayList("jats", "text", "zones", "trueviz", "images", "bibtex")); if (!outputs.isEmpty()) { return "Unknown output types: " + outputs; } if (exts != null && output.split(",").length != exts.split(",").length) { return "\"output\" and \"exts\" lists have different lengths"; } } return null; }
CommandLineOptionsParser { public String parse(String[] args) throws ParseException { CommandLineParser clParser = new DefaultParser(); commandLine = clParser.parse(options, args); if (commandLine.getOptionValue("path") == null) { return "\"path\" parameter not specified"; } String output = commandLine.getOptionValue("outputs"); String exts = commandLine.getOptionValue("exts"); if (output != null) { List<String> outputs = Lists.newArrayList(output.split(",")); outputs.removeAll(Lists.newArrayList("jats", "text", "zones", "trueviz", "images", "bibtex")); if (!outputs.isEmpty()) { return "Unknown output types: " + outputs; } if (exts != null && output.split(",").length != exts.split(",").length) { return "\"output\" and \"exts\" lists have different lengths"; } } return null; } }
CommandLineOptionsParser { public String parse(String[] args) throws ParseException { CommandLineParser clParser = new DefaultParser(); commandLine = clParser.parse(options, args); if (commandLine.getOptionValue("path") == null) { return "\"path\" parameter not specified"; } String output = commandLine.getOptionValue("outputs"); String exts = commandLine.getOptionValue("exts"); if (output != null) { List<String> outputs = Lists.newArrayList(output.split(",")); outputs.removeAll(Lists.newArrayList("jats", "text", "zones", "trueviz", "images", "bibtex")); if (!outputs.isEmpty()) { return "Unknown output types: " + outputs; } if (exts != null && output.split(",").length != exts.split(",").length) { return "\"output\" and \"exts\" lists have different lengths"; } } return null; } CommandLineOptionsParser(); }
CommandLineOptionsParser { public String parse(String[] args) throws ParseException { CommandLineParser clParser = new DefaultParser(); commandLine = clParser.parse(options, args); if (commandLine.getOptionValue("path") == null) { return "\"path\" parameter not specified"; } String output = commandLine.getOptionValue("outputs"); String exts = commandLine.getOptionValue("exts"); if (output != null) { List<String> outputs = Lists.newArrayList(output.split(",")); outputs.removeAll(Lists.newArrayList("jats", "text", "zones", "trueviz", "images", "bibtex")); if (!outputs.isEmpty()) { return "Unknown output types: " + outputs; } if (exts != null && output.split(",").length != exts.split(",").length) { return "\"output\" and \"exts\" lists have different lengths"; } } return null; } CommandLineOptionsParser(); String parse(String[] args); String getPath(); Map<String, String> getTypesAndExtensions(); boolean override(); String getNLMExtension(); String getTextExtension(); boolean extractStructure(); String getBxExtension(); Long getTimeout(); String getConfigurationPath(); }
CommandLineOptionsParser { public String parse(String[] args) throws ParseException { CommandLineParser clParser = new DefaultParser(); commandLine = clParser.parse(options, args); if (commandLine.getOptionValue("path") == null) { return "\"path\" parameter not specified"; } String output = commandLine.getOptionValue("outputs"); String exts = commandLine.getOptionValue("exts"); if (output != null) { List<String> outputs = Lists.newArrayList(output.split(",")); outputs.removeAll(Lists.newArrayList("jats", "text", "zones", "trueviz", "images", "bibtex")); if (!outputs.isEmpty()) { return "Unknown output types: " + outputs; } if (exts != null && output.split(",").length != exts.split(",").length) { return "\"output\" and \"exts\" lists have different lengths"; } } return null; } CommandLineOptionsParser(); String parse(String[] args); String getPath(); Map<String, String> getTypesAndExtensions(); boolean override(); String getNLMExtension(); String getTextExtension(); boolean extractStructure(); String getBxExtension(); Long getTimeout(); String getConfigurationPath();  }