@Test public void testAddInputFile() throws Exception { final String inputName = "input.txt"; final File input = temp.newFile(inputName); final BaseConfiguration conf = new BaseConfiguration(); conf.addProperty(ExternalProcess.PROP_EXEC, "test.sh"); conf.addProperty(ExternalProcess.PROP_ARG, "-i ${input.file.name}"); conf.addProperty(ExternalProcess.PROP_ARG, "-path ${input.file}[0]"); conf.addProperty(ExternalProcess.PROP_ARG, "-o ${input.folder}"); GenericExternalProcess gp = new GenericExternalProcess(conf).addInputFile(input); assertEquals(gp.getParameters().getMap().get(GenericExternalProcess.SRC_NAME_EXT), input.getName()); assertEquals(gp.getParameters().getMap().get(GenericExternalProcess.SRC_PATH), input.getAbsolutePath()); assertEquals(gp.getParameters().getMap().get(GenericExternalProcess.SRC_PARENT), input.getParentFile().getAbsolutePath()); List<String> cmdLines = gp.buildCmdLine(conf); }
public GenericExternalProcess addInputFile(File file) { this.inputFile = file; parameters.addInputFile(file); return this; }
GenericExternalProcess extends ExternalProcess { public GenericExternalProcess addInputFile(File file) { this.inputFile = file; parameters.addInputFile(file); return this; } }
GenericExternalProcess extends ExternalProcess { public GenericExternalProcess addInputFile(File file) { this.inputFile = file; parameters.addInputFile(file); return this; } GenericExternalProcess(Configuration conf); }
GenericExternalProcess extends ExternalProcess { public GenericExternalProcess addInputFile(File file) { this.inputFile = file; parameters.addInputFile(file); return this; } GenericExternalProcess(Configuration conf); GenericExternalProcess addInputFile(File file); File getInputFile(); GenericExternalProcess addOutputFile(File file); File getOutputFile(); ParamHandler getParameters(); Map<String, String> getResultParameters(); ProcessResult getResult(); @Override void run(); boolean isSkippedProcess(); }
GenericExternalProcess extends ExternalProcess { public GenericExternalProcess addInputFile(File file) { this.inputFile = file; parameters.addInputFile(file); return this; } GenericExternalProcess(Configuration conf); GenericExternalProcess addInputFile(File file); File getInputFile(); GenericExternalProcess addOutputFile(File file); File getOutputFile(); ParamHandler getParameters(); Map<String, String> getResultParameters(); ProcessResult getResult(); @Override void run(); boolean isSkippedProcess(); static final String DST_PARENT; static final String DST_PATH; static final String SRC_EXT; static final String SRC_NAME; static final String SRC_NAME_EXT; static final String SRC_PATH; static final String SRC_PARENT; }