1 11 package org.eclipse.core.internal.net; 12 13 import org.eclipse.core.net.proxy.IProxyData; 14 15 public class ProxyData implements IProxyData { 16 17 private String type; 18 private String host; 19 private int port; 20 private String user; 21 private String password; 22 private boolean requiresAuthentication; 23 24 public ProxyData(String type, String host, int port, boolean requiresAuthentication) { 25 this.type = type; 26 this.host = host; 27 this.port = port; 28 this.requiresAuthentication = requiresAuthentication; 29 } 30 31 public ProxyData(String type) { 32 this.type = type; 33 } 34 35 public String getHost() { 36 return host; 37 } 38 39 public String getPassword() { 40 return password; 41 } 42 43 public int getPort() { 44 return port; 45 } 46 47 public String getType() { 48 return type; 49 } 50 51 public String getUserId() { 52 return user; 53 } 54 55 public void setHost(String host) { 56 if (host.length() == 0) 57 host = null; 58 this.host = host; 59 } 60 61 public void setPassword(String password) { 62 this.password = password; 63 } 64 65 public void setPort(int port) { 66 this.port = port; 67 } 68 69 public void setUserid(String userid) { 70 this.user = userid; 71 requiresAuthentication = userid != null; 72 } 73 74 public boolean isRequiresAuthentication() { 75 return requiresAuthentication; 76 } 77 78 public void disable() { 79 host = null; 80 port = -1; 81 user = null; 82 password = null; 83 requiresAuthentication = false; 84 } 85 86 } 87 | Popular Tags |