- Timestamp:
- 09/21/09 14:39:41 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/jabberit_messenger/java_source/src/nu/fw/jeti/backend/LoginInfo.java
r1014 r1424 30 30 31 31 import nu.fw.jeti.util.Utils; 32 32 33 33 34 /** … … 48 49 private String resource; 49 50 private String password; 50 private boolean useJavaProxy=true;51 51 private boolean ssl=false; 52 52 private int proxyType=NO_PROXY; … … 54 54 private String proxyPort; 55 55 private String proxyUsername; 56 private String proxyPassword; //encrypt?56 private String proxyPassword; 57 57 private int priority; 58 58 59 59 //applet 60 public LoginInfo(String server, String host, String username, 61 String password,String resource,int port,boolean ssl,int priority)62 { 63 if( username != null && username.indexOf("@")!=-1 )60 public LoginInfo(String server, String host, String username,String password, 61 String resource,int port,boolean ssl,int priority) 62 { 63 if(username!=null && username.indexOf("@")!=-1 ) 64 64 { 65 65 this.host = server; … … 85 85 } 86 86 87 public LoginInfo(String server, String host, String username, 88 String password, String resource,int port, boolean ssl,int priority, 89 boolean useProxy) 90 { 91 this(server,host,username,password,resource,port,ssl,priority); 92 this.useJavaProxy = useProxy; 93 } 94 95 public LoginInfo(String server, String host, String username, 87 public LoginInfo(String server, String host, String username, 96 88 String password, String resource,int port, boolean ssl,int priority, 97 89 int proxy, String proxyServer, String proxyUsername, 98 String proxyPassword, String proxyPort )90 String proxyPassword, String proxyPort ) 99 91 { 100 92 this(server,host,username,password,resource,port,ssl,priority); … … 106 98 } 107 99 100 public LoginInfo(String server, String host, String username, String password, String resource, 101 int port, boolean ssl, String proxyServer, String proxyPort) 102 { 103 this.server = server; 104 this.host = host; 105 this.username = username; 106 this.password = password; 107 this.resource = resource; 108 this.port = port; 109 this.ssl = ssl; 110 this.proxyServer = proxyServer; 111 this.proxyPort = proxyPort; 112 } 113 108 114 /** 109 115 * Returns the port. … … 143 149 144 150 /** 145 * Returns the useJavaProxy.146 * @return boolean147 */148 public boolean getJavaProxy()149 {150 return useJavaProxy;151 }152 153 /**154 151 * Returns the ssl. 155 152 * @return boolean … … 190 187 } 191 188 189 public void setProxyPassword(String proxyPassword) 190 { 191 this.proxyPassword = proxyPassword; 192 } 193 192 194 /** 193 195 * Returns the proxyPassword. … … 217 219 } 218 220 221 /** 222 * Set the proxyUsername; 223 * 224 */ 225 226 public void setProxyUsername(String proxyUsername) 227 { 228 this.proxyUsername = proxyUsername; 229 } 230 219 231 /** 220 232 * Returns the proxyUsername. … … 247 259 public boolean isHTTPProxy() 248 260 { 261 //System.out.println( "( " + proxyType + "==" + LoginInfo.HTTP_PROXY + " ) = " + useProxy(LoginInfo.HTTP_PROXY)); 262 249 263 if( useProxy(LoginInfo.HTTP_PROXY) ) 250 264 return true; 251 252 if( Start.applet ) 253 { 254 try 255 { 256 ProxyInfo info[] = ProxyService.getProxyInfo(new URL("http://www.google.com.br")); 257 258 if (info != null && info.length > 0 ) 259 { 260 proxyType = HTTP_PROXY; 261 proxyServer = info[0].getHost(); 262 proxyPort = String.valueOf(info[0].getPort()); 263 return true; 264 } 265 266 } 267 catch (Exception ex) 268 { 269 System.err.println("could not retrieve proxy configuration, attempting direct connection."); 270 } 271 } 272 return false; 273 } 274 265 else 266 return false; 267 } 275 268 } 276 269 /*
Note: See TracChangeset
for help on using the changeset viewer.