/** * Initialise a feeder on a slurper * * @param slurper * @throws IOException */ public InputStreamFeeder(PicSlurper slurper) throws IOException { factory = new z_T4JInternalJSONImplFactory(null); if (FileToolsUtil.isStdin(slurper)) { slurper.stdin = true; } else { slurper.inputFiles = FileToolsUtil.validateLocalInput(slurper); slurper.fileIterator = slurper.inputFiles.iterator(); } }
@Override public boolean validate() throws CmdLineException{ try{ if(FileToolsUtil.isStdin(this)){ this.stdin = true; } else{ this.inputFiles = FileToolsUtil.validateLocalInput(this); } if(FileToolsUtil.isStdout(this)){ this.stdout = true; } else { this.outputFile = FileToolsUtil.validateLocalOutput(this); } return true; } catch(Exception e){ throw new CmdLineException(null,e.getMessage()); } }
@Override public boolean validate() throws CmdLineException{ try{ if(FileToolsUtil.isStdin(this)){ this.stdin = true; } else{ this.inputFiles = FileToolsUtil.validateLocalInput(this); } if(FileToolsUtil.isStdout(this)){ this.stdout = true; } else { this.outputFile = FileToolsUtil.validateLocalOutput(this); } return true; } catch(Exception e){ throw new CmdLineException(null,e.getMessage()); } }
void validate() throws CmdLineException { try { if (FileToolsUtil.isStdin(this)) { this.stdin = true; } else { this.inputFiles = FileToolsUtil.validateLocalInput(this); this.fileIterator = this.inputFiles.iterator(); } if (FileToolsUtil.isStdout(this)) { this.stdout = true; } else { this.outputLocation = validateLocalOutput(this.getOutput(), this.isForce(), !this.isContinue()); this.outputLocation.mkdirs(); this.globalStatus = new File(outputLocation, STATUS_FILE_NAME); // init the output file PicSlurperUtils.updateStats(this.globalStatus, new StatusConsumption()); } } catch (final Exception e) { throw new CmdLineException(null, e.getMessage()); } }