Advertisement
Guest User

Untitled

a guest
Sep 13th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. private void buildURL() {
  2. url = "";
  3. if(endpointType.equals("ftp")) {
  4. url += "ftp";
  5. } else if(endpointType.equals("file")) {
  6. url += "file";
  7. }
  8. url += "://"+username+"@"+ip+"/"+folder+"?";
  9. if(!password.equals("")) {
  10. url+="password="+password+"&";
  11. }
  12. if(delete) {
  13. url += DELETE_CONDITIONS;
  14. } else {
  15. url += NON_DELETE_CONDITIONS;
  16. }
  17. }
  18. private void initConfigParameters(@SuppressWarnings("rawtypes") Dictionary props) {
  19. confLine = Integer.parseInt((String) props.get(Config.CONFIG_LINE));
  20. name = (String) props.get(Config.NAME);
  21. endpointType = (String) props.get(Config.ENDPOINT_TYPE);
  22. ip = (String) props.get(Config.IP_ADDRESS);
  23. username = (String) props.get(Config.USERNAME);
  24. password = (String) props.get(Config.PASSWORD);
  25. folder = (String) props.get(Config.FOLDER);
  26. delete = ((String) props.get(Config.DELETE)).equals("true");
  27. printParameters();
  28. }
  29. private void printParameters() {
  30. System.out.println("\nStarting camel with parameters:");
  31. System.out.println("[sensor_name]::"+name);
  32. System.out.println("[endpoint_type]::"+endpointType);
  33. System.out.println("[ip_address]::"+ip);
  34. System.out.println("[user]::"+username);
  35. System.out.println("[password]::"+password);
  36. System.out.println("[folder]::"+folder);
  37. System.out.println("[delete]::"+delete);
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement