Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package camelinaction.typesafeProdCons;
- import org.apache.commons.httpclient.NameValuePair;
- import org.apache.commons.lang3.ArrayUtils;
- class FileConsumerTemplate{
- public static final String scheme = "file:";
- private String adress;
- private NameValuePair[] params;
- FileConsumerTemplate(String adress) {
- this.adress = adress;
- }
- public String getAdress() {
- return adress;
- }
- public void setAdress(String adress) {
- this.adress = adress;
- }
- /**
- * <Javadoc from http://camel.apache.org/file2.html here>
- * @param noop
- * @return
- */
- public FileConsumerTemplate setNoop(boolean noop){
- return addParam("noop", noop + "");
- }
- /**
- * <Javadoc from http://camel.apache.org/file2.html here>
- * @param recursive
- * @return
- */
- public FileConsumerTemplate setRecursive(boolean recursive){
- return addParam("recursive", recursive + "");
- }
- private FileConsumerTemplate addParam(String name, String value){
- params = ArrayUtils.add(params, new NameValuePair(name, value));
- return this;
- }
- public String get() {
- return new UriHelper().getUriWithParams(scheme+adress, params);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement