05-15-2018 10:47 PM
Hi
i have a snap with binary input but now i want to change my binary input to document input what changes i need to do.
Below is my code snippet as document input.
@General(title = "xyz parser", purpose = "Smaple Snap", author = "Nikhil", docLink = "http://anyurl.com/")
@Outputs(min = 1, max = 1, offers = ViewType.DOCUMENT)
@Errors(min = 1, max = 1, offers = ViewType.DOCUMENT)
@Version(snap = 1)
@Category(snap = SnapCategory.PARSE)
public class XYZParser extends SimpleBinaryWriteSnap implements DependencyManager {
@Inject
private DocumentUtility documentUtility;
@Inject
private URLEncoder urlEncoder;
@Inject
private JfsUtils jfsUtils;
@Override
public Module getManagedModule() {
return new AbstractModule() {
@Override
protected void configure() {
bind(ForEx.class).to(ForExImpl.class);
bind(JfsUtils.class).toInstance(JfsUtils.getInstance());
}
};
}
@Override
public void defineProperties(PropertyBuilder propertyBuilder) {
// configuration code here
}
@Override
public void configure(PropertyValues propertyValues) throws ConfigurationException {
// configuration code here
}
@Override
public void cleanup() throws ExecutionException {
// TODO Auto-generated method stub
}
@Override
protected void process(final Document document, final ReadableByteChannel readChannel) {
// main process code here
// writing output
outputViews.write(documentUtility.newDocument(data),document);
}
}
please give me code snippet as above when input is binary input.
Thanks
Nikhil Purohit
05-17-2018 12:46 PM
Extend SimpleWriteSnap
instead.
05-18-2018 08:23 AM
Thanks @robin