| 1 package com.sslexplorer.agent.client; 2 3 9 public class ProxyInfo { 10 11 private String protocol; 13 private String username; 14 private String password; 15 private String hostname; 16 private int port; 17 private String sourceIdent; 18 19 20 30 public ProxyInfo(String protocol, String username, String password, String hostname, int port, String sourceIdent) { 31 super(); 32 this.protocol = protocol; 33 this.username = username; 34 this.password = password; 35 this.hostname = hostname; 36 this.port = port; 37 this.sourceIdent = sourceIdent; 38 } 39 40 46 public String toUri() { 47 StringBuffer buf = new StringBuffer (getProtocol()); 48 buf.append("://"); if(username != null && !username.equals("")) { buf.append(username); 51 if(password != null && !password.equals("")) { buf.append(":"); buf.append(password); 54 } 55 buf.append("@"); } 57 buf.append(hostname); 58 if(port != 0) { 59 buf.append(":"); buf.append(port); 61 } 62 return buf.toString(); 63 } 64 65 70 public String getHostname() { 71 return hostname; 72 } 73 74 79 public String getPassword() { 80 return password; 81 } 82 83 88 public int getPort() { 89 return port; 90 } 91 92 97 public String getProtocol() { 98 return protocol; 99 } 100 101 108 public String getSourceIdent() { 109 return sourceIdent; 110 } 111 112 117 public String getUsername() { 118 return username; 119 } 120 } 121 | Popular Tags |