@Execute public void runProcess() { GenericFileData gfd = data.get(0); File f = gfd.getBaseFile(false); try { result = new GenericFileData(f, gfd.getMimeType()); } catch (IOException e) { LOGGER.error(e.getMessage(), e); } } }
public InputStream generateStream(IData data, String mimeType, String schema) throws IOException { InputStream theStream = ((GenericFileDataBinding)data).getPayload().getDataStream(); return theStream; }
public String writeData(File workspaceDir) { String fileName = null; if (GenericFileDataConstants.getIncludeFilesByMimeType(mimeType) != null) { try { fileName = unzipData(dataStream, fileExtension, workspaceDir); } catch (IOException e) { LOGGER.error("Could not unzip the archive to " + workspaceDir); } } else { try { fileName = justWriteData(dataStream, fileExtension, workspaceDir); } catch (IOException e) { LOGGER.error("Could not write the input to " + workspaceDir); } } return fileName; }
processor.addData(inputID, new MediaData(gfd.getDataStream(), gfd.getMimeType())); break; default: GenericFileData gfd = new GenericFileData(md.getMediaStream(), md.getMimeType()); result.put(param.getMessageOutputIdentifier(), new GenericFileDataBinding(gfd)); break;
@Override public GenericFileDataBinding parse(InputStream input, String mimeType, String schema) { GenericFileData theData = new GenericFileData(input, mimeType); LOGGER.info("Found File Input " + mimeType); return new GenericFileDataBinding(theData); }
@Execute public void runProcess() { GenericFileData gfd = null; File f = null; for (GenericFileData genericFileData : data) { gfd = genericFileData; f = gfd.getBaseFile(false); if(!f.exists()){ throw new RuntimeException("Input file does not exist for identifier data."); } } try { result = new GenericFileData(f, gfd.getMimeType()); } catch (IOException e) { LOGGER.error(e.getMessage(), e); } } }
GenericFileData genericFileData = genericFileDataBinding.getPayload(); try { result.put(outputID1, new GenericFileDataBinding(new GenericFileData(genericFileData.getBaseFile(false), genericFileData.getMimeType()))); } catch (IOException e) { errors.add(e.getMessage()); GenericFileData genericFileData = genericFileDataBinding.getPayload(); try { result.put(outputID2, new GenericFileDataBinding(new GenericFileData(genericFileData.getBaseFile(false), genericFileData.getMimeType()))); } catch (IOException e) { errors.add(e.getMessage());