|
Removed
Link Here
|
| 1 |
/********************************************************************** |
| 2 |
* Copyright (c) 2005, 2007 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
| 6 |
* http://www.eclipse.org/legal/epl-v10.html |
| 7 |
* $Id: RecorderRegistryInfo.java,v 1.13 2007/10/23 14:14:41 dmorris Exp $ |
| 8 |
* |
| 9 |
* Contributors: |
| 10 |
* IBM Corporation - initial API and implementation |
| 11 |
**********************************************************************/ |
| 12 |
|
| 13 |
/* |
| 14 |
* Created on Mar 4, 2004 |
| 15 |
* |
| 16 |
* To change the template for this generated file go to |
| 17 |
* Window>Preferences>Java>Code Generation>Code and Comments |
| 18 |
*/ |
| 19 |
package org.eclipse.hyades.internal.execution.recorder.ui.wizards; |
| 20 |
|
| 21 |
import java.io.File; |
| 22 |
import java.io.FileInputStream; |
| 23 |
|
| 24 |
import java.io.IOException; |
| 25 |
import java.io.InputStreamReader; |
| 26 |
import java.net.URL; |
| 27 |
import java.util.StringTokenizer; |
| 28 |
|
| 29 |
import org.eclipse.core.runtime.FileLocator; |
| 30 |
import org.eclipse.core.runtime.IPath; |
| 31 |
import org.eclipse.core.runtime.Platform; |
| 32 |
import org.eclipse.hyades.execution.recorder.local.appadapters.JNIWrapper; |
| 33 |
import org.osgi.framework.Bundle; |
| 34 |
|
| 35 |
/** |
| 36 |
* @author mdunn |
| 37 |
* |
| 38 |
* To change the template for this generated type comment go to |
| 39 |
* Window>Preferences>Java>Code Generation>Code and Comments |
| 40 |
*/ |
| 41 |
public class RecorderRegistryInfo { |
| 42 |
|
| 43 |
private String proxyType = ""; |
| 44 |
private String proxyAddr = ""; |
| 45 |
private String proxyPort = ""; |
| 46 |
private boolean isProxyEnabled = false; |
| 47 |
private boolean badProxySettings = false; |
| 48 |
private int proxyError = 0; |
| 49 |
// defect 82974 1/18/2005 |
| 50 |
private boolean isAutoConfigURLEnabled = false; |
| 51 |
private boolean isProxyOverrideEnabled = false; |
| 52 |
|
| 53 |
public final int PROXY_SETTINGS_OK = 0; |
| 54 |
public final int SOCKS_SET = -1; |
| 55 |
public final int HTTP_PROXY_ONLY_SET = -2; |
| 56 |
public final int SECURE_PROXY_ONLY_SET = -3; |
| 57 |
public final int HTTP_SECURE_MISMATCH = -4; |
| 58 |
public final int HTTP_SECURE_LOCALHOST = -5; |
| 59 |
public final int HTTP_PROXY_OVERRIDE = -6; |
| 60 |
public final int AUTO_CONFIG_URL = -7; |
| 61 |
// below is for bugzilla 177396 mdd |
| 62 |
public final int VISTA_ADMIN_ERROR = -8; |
| 63 |
public final int WINDOWS_ADMIN_ERROR = -8; |
| 64 |
public final int BROWSER_IN_USE_ERROR = -9; |
| 65 |
public final int RECORDING_TPTPRECUTIL_DLL_MISSING = -10; |
| 66 |
// bugzilla 79219 mdd |
| 67 |
private String sslProxyAddr = ""; |
| 68 |
private String sslProxyPort = ""; |
| 69 |
private String secureStringGlobal = ""; |
| 70 |
private boolean isSSLProxyEnabled = false; |
| 71 |
// new stuff bugzilla 89968 mdd |
| 72 |
private String proxyOverrideString = ""; |
| 73 |
private String autoConfigURLString = ""; |
| 74 |
|
| 75 |
private boolean bUseNativeRegistryInterface = false; |
| 76 |
private JNIWrapper jniWrapper = null; |
| 77 |
|
| 78 |
public RecorderRegistryInfo() { |
| 79 |
StringBuffer inputFileContents = new StringBuffer(); |
| 80 |
// return of false indicates fatal error |
| 81 |
checkOSVersion(inputFileContents); |
| 82 |
if (bUseNativeRegistryInterface) |
| 83 |
getRegistryInfoUsingNativeAPI(inputFileContents); |
| 84 |
else |
| 85 |
getRegistryInfo(inputFileContents); |
| 86 |
|
| 87 |
// below is for bugzilla 177396 mdd |
| 88 |
String checkVistaError=inputFileContents.toString(); |
| 89 |
if (checkVistaError.equalsIgnoreCase("VISTA_ADMIN_ERROR")) { |
| 90 |
setBadProxySettings(true); |
| 91 |
setProxyError(VISTA_ADMIN_ERROR); |
| 92 |
} |
| 93 |
else if (checkVistaError.equalsIgnoreCase("WINDOWS_ADMIN_ERROR")) { |
| 94 |
setBadProxySettings(true); |
| 95 |
setProxyError(WINDOWS_ADMIN_ERROR); |
| 96 |
} |
| 97 |
else if (checkVistaError.equalsIgnoreCase("BROWSER_IN_USE_ERROR")) { |
| 98 |
setBadProxySettings(true); |
| 99 |
setProxyError(BROWSER_IN_USE_ERROR); |
| 100 |
} |
| 101 |
if (checkVistaError.equalsIgnoreCase("RECORDING_TPTPRECUTIL_DLL_MISSING")) { |
| 102 |
setBadProxySettings(true); |
| 103 |
setProxyError(RECORDING_TPTPRECUTIL_DLL_MISSING); |
| 104 |
} |
| 105 |
else { |
| 106 |
boolean isEnabled = checkProxyEnabled(inputFileContents); |
| 107 |
setProxyEnabled(isEnabled); |
| 108 |
if (! isEnabled ) { |
| 109 |
setProxyType("socks"); |
| 110 |
} |
| 111 |
else { |
| 112 |
// must do it new way for hyades 1.3 mdd |
| 113 |
// make sure it is http proxy, grab the address and port |
| 114 |
// then set ProxyServer http=localhost:1080 |
| 115 |
String proxyInfo = getProxyInfo(inputFileContents); |
| 116 |
if (isProxyEnabled && isProxyOverrideEnabled) { |
| 117 |
setBadProxySettings(true); |
| 118 |
setProxyError(HTTP_PROXY_OVERRIDE); |
| 119 |
} |
| 120 |
if (proxyInfo.length()!= 0) { |
| 121 |
String[] proxySplit = proxyInfo.split(":"); |
| 122 |
String myProxyAddr = proxySplit[0]; |
| 123 |
String myProxyPort = proxySplit[1]; |
| 124 |
setProxyAddr(myProxyAddr); |
| 125 |
setProxyPort(myProxyPort); |
| 126 |
setProxyType("http"); |
| 127 |
// defect 79219 |
| 128 |
if (secureStringGlobal.length()!= 0) { |
| 129 |
String[] sslSplit = secureStringGlobal.split(":"); |
| 130 |
String mysslProxyAddr = sslSplit[0]; |
| 131 |
String mysslProxyPort = sslSplit[1]; |
| 132 |
setSslProxyAddr(mysslProxyAddr); |
| 133 |
setSslProxyPort(mysslProxyPort); |
| 134 |
} |
| 135 |
} |
| 136 |
else { |
| 137 |
setProxyType("socks"); |
| 138 |
} |
| 139 |
} |
| 140 |
} |
| 141 |
} |
| 142 |
|
| 143 |
private boolean checkOSVersion(StringBuffer inputFileContents){ |
| 144 |
String currentOS = Platform.getOS(); |
| 145 |
if (currentOS.equals("win32")) { |
| 146 |
String myVersion = System.getProperty("os.version"); |
| 147 |
if (myVersion.startsWith("6")) { |
| 148 |
try{ |
| 149 |
// Bugilla 168597, use native registry calls |
| 150 |
// instead of displaying an error message |
| 151 |
Bundle b = Platform.getBundle("org.eclipse.hyades.test.core"); |
| 152 |
URL u = FileLocator.resolve(b.getEntry("/")); |
| 153 |
String path = u.getPath(); |
| 154 |
path = path.substring(1); |
| 155 |
String finalPath = path + "TPTPRecUtil.dll"; |
| 156 |
File dllFile = new File(finalPath); |
| 157 |
if (dllFile.exists() == false){ |
| 158 |
return false; |
| 159 |
} |
| 160 |
|
| 161 |
|
| 162 |
jniWrapper = new JNIWrapper(); |
| 163 |
if (jniWrapper.isProcessRunningElevated() == false){ |
| 164 |
bUseNativeRegistryInterface = true; |
| 165 |
if (jniWrapper.isBrowserRunning() == true){ |
| 166 |
inputFileContents.append("BROWSER_IN_USE_ERROR"); |
| 167 |
return false; |
| 168 |
} |
| 169 |
} |
| 170 |
} |
| 171 |
catch (IOException ioe){ |
| 172 |
|
| 173 |
} |
| 174 |
|
| 175 |
// so, if we can't load our DLL, we will throw the old |
| 176 |
// error message out so the user can perform a recording by |
| 177 |
// running eclipse using "Run as Adminstrator |
| 178 |
// this should never happen |
| 179 |
catch (UnsatisfiedLinkError e2){ |
| 180 |
inputFileContents.append("VISTA_ADMIN_ERROR"); |
| 181 |
return false; |
| 182 |
} |
| 183 |
} |
| 184 |
} |
| 185 |
return true; |
| 186 |
} |
| 187 |
|
| 188 |
private void getRegistryInfo(StringBuffer inputFileContents) |
| 189 |
{ |
| 190 |
String originalSettingsFileName = "newSettingsFile.tmp"; |
| 191 |
String originalSettingsFilePath = ""; |
| 192 |
// bugzilla 126592 mdd change location of temp file |
| 193 |
originalSettingsFilePath = getTempPath(); |
| 194 |
originalSettingsFilePath += "\\" + originalSettingsFileName; |
| 195 |
// bugzilla 127536 mdd put quotes around file path due to spaces in workspace path |
| 196 |
String getOriginalInfoCommandLine = "regedit /e "+"\"" + originalSettingsFilePath+"\"" + " \"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\"";//$NON-NLS-1$//$NON-NLS-2$ |
| 197 |
InputStreamReader inputReader=null; |
| 198 |
File file = null; |
| 199 |
try |
| 200 |
{ |
| 201 |
try { |
| 202 |
Process registryChange = Runtime.getRuntime().exec(getOriginalInfoCommandLine,null); |
| 203 |
registryChange.waitFor(); |
| 204 |
} |
| 205 |
catch (InterruptedException e) {} |
| 206 |
// bugzilla 126592 mdd use originalSettingsFilePath rather than ...FileName |
| 207 |
file = new File(originalSettingsFilePath); |
| 208 |
inputReader= new InputStreamReader(new FileInputStream(file),"UTF-16");//$NON-NLS-1$ |
| 209 |
inputFileContents = new StringBuffer(); |
| 210 |
char[] inputBuf = new char[1000]; |
| 211 |
int bytesRead = inputReader.read(inputBuf); |
| 212 |
|
| 213 |
while(bytesRead!=-1) |
| 214 |
{ |
| 215 |
inputFileContents.append(inputBuf,0,bytesRead); |
| 216 |
bytesRead = inputReader.read(inputBuf); |
| 217 |
} |
| 218 |
} |
| 219 |
catch (IOException e) |
| 220 |
{ |
| 221 |
String currentOS = Platform.getOS(); |
| 222 |
if (currentOS.equals("win32")) { |
| 223 |
String myVersion = System.getProperty("os.version"); |
| 224 |
if (myVersion.startsWith("6")) { |
| 225 |
inputFileContents.append("RECORDING_TPTPRECUTIL_DLL_MISSING"); |
| 226 |
}else { |
| 227 |
inputFileContents.append("WINDOWS_ADMIN_ERROR"); |
| 228 |
e.printStackTrace(); |
| 229 |
} |
| 230 |
} |
| 231 |
|
| 232 |
} |
| 233 |
|
| 234 |
finally |
| 235 |
{ |
| 236 |
if(inputReader!=null) |
| 237 |
try |
| 238 |
{ |
| 239 |
inputReader.close(); |
| 240 |
} |
| 241 |
catch (IOException e1) |
| 242 |
{ |
| 243 |
e1.printStackTrace(); |
| 244 |
} |
| 245 |
} |
| 246 |
// Clean up |
| 247 |
if (file != null) { |
| 248 |
if (file.exists()) |
| 249 |
file.delete(); |
| 250 |
} |
| 251 |
return; |
| 252 |
} |
| 253 |
|
| 254 |
// added for Bugilla 168597 |
| 255 |
private void getRegistryInfoUsingNativeAPI(StringBuffer inputFileContents){ |
| 256 |
// fire up an instance of the JNI layer to start using native code |
| 257 |
AddSettingToBuffer(jniWrapper, inputFileContents, "ProxyEnable"); |
| 258 |
AddSettingToBuffer(jniWrapper, inputFileContents, "AutoConfigURL"); |
| 259 |
AddSettingToBuffer(jniWrapper, inputFileContents, "ProxyServer"); |
| 260 |
AddSettingToBuffer(jniWrapper, inputFileContents, "ProxyOverride"); |
| 261 |
|
| 262 |
return; |
| 263 |
} |
| 264 |
|
| 265 |
private void AddSettingToBuffer(JNIWrapper jniWrapper, StringBuffer inputFileContents, String name){ |
| 266 |
String setting = jniWrapper.getInternetSetting(name); |
| 267 |
if (setting != null && setting.length() > 0){ |
| 268 |
inputFileContents.append("\"" + name + "\"=" + setting + "\r\n"); |
| 269 |
} |
| 270 |
return; |
| 271 |
} |
| 272 |
|
| 273 |
|
| 274 |
private boolean checkProxyEnabled(StringBuffer inputBuffer) |
| 275 |
{ |
| 276 |
boolean comparesOK = false; |
| 277 |
StringTokenizer fileTokenizer = new StringTokenizer(inputBuffer.toString(),"\r\n");//$NON-NLS-1$ |
| 278 |
while(fileTokenizer.hasMoreTokens()) |
| 279 |
{ |
| 280 |
String line=fileTokenizer.nextToken(); |
| 281 |
String newLine = line; |
| 282 |
// example ProxyServer is key, "http=markdunn:1000;socks=localhost:450" |
| 283 |
if(line.startsWith("\"ProxyEnable"))//$NON-NLS-1$ |
| 284 |
{ |
| 285 |
StringTokenizer lineTokenizer = new StringTokenizer(line,":");//$NON-NLS-1$ |
| 286 |
newLine=lineTokenizer.nextToken(); // get ProxyEnable |
| 287 |
newLine=lineTokenizer.nextToken(); |
| 288 |
if (newLine.equalsIgnoreCase("00000001")) |
| 289 |
comparesOK = true; |
| 290 |
|
| 291 |
} //defect 82974 below - also check AutoConfigURL |
| 292 |
else if (line.startsWith("\"AutoConfigURL")) { |
| 293 |
setBadProxySettings(true); |
| 294 |
setProxyError(AUTO_CONFIG_URL); |
| 295 |
setAutoConfigURLEnabled(true); |
| 296 |
String autoConfigStr = ""; |
| 297 |
autoConfigStr = findAutoConfigURLString(line); |
| 298 |
setAutoConfigURLString(autoConfigStr); |
| 299 |
break; |
| 300 |
} |
| 301 |
} |
| 302 |
return comparesOK; |
| 303 |
} |
| 304 |
|
| 305 |
private String getProxyInfo(StringBuffer inputBuffer) |
| 306 |
{ |
| 307 |
String proxyString = ""; |
| 308 |
String httpString = "http="; |
| 309 |
String secureString = "https="; |
| 310 |
String socksString = "socks="; |
| 311 |
String equalsString = "="; |
| 312 |
String HTTPString = ""; |
| 313 |
String SECUREString = ""; |
| 314 |
int findSOCKS = -1; |
| 315 |
int findHTTP = -1; |
| 316 |
int findSECURE = -1; |
| 317 |
StringTokenizer fileTokenizer = new StringTokenizer(inputBuffer.toString(),"\r\n");//$NON-NLS-1$ |
| 318 |
while(fileTokenizer.hasMoreTokens()) |
| 319 |
{ |
| 320 |
String line=fileTokenizer.nextToken(); |
| 321 |
// example ProxyServer is key, "http=markdunn:1000;https=mdunnlinux:3128;socks=localhost:450" |
| 322 |
// or "mdunnlinux:3128 - which means use this proxy for all protocols |
| 323 |
|
| 324 |
if(line.startsWith("\"ProxyServer"))//$NON-NLS-1$ |
| 325 |
{ |
| 326 |
String tmp = "\"ProxyServer\"="; |
| 327 |
String modifiedLine = line.substring(tmp.length()); |
| 328 |
String [] entireString = modifiedLine.split(";"); |
| 329 |
int numVars = entireString.length; |
| 330 |
for (int i =0; i < numVars; i++){ |
| 331 |
String tmpEntireString = entireString[i].replaceAll("\"",""); |
| 332 |
int findEqualsString = tmpEntireString.indexOf(equalsString); |
| 333 |
if (findEqualsString == -1) { |
| 334 |
proxyString = tmpEntireString; |
| 335 |
} |
| 336 |
else { |
| 337 |
if (findSOCKS == -1){ |
| 338 |
findSOCKS = tmpEntireString.indexOf(socksString); |
| 339 |
if (findSOCKS >= 0) |
| 340 |
break; |
| 341 |
} |
| 342 |
if (findHTTP == -1) { |
| 343 |
findHTTP = tmpEntireString.indexOf(httpString); |
| 344 |
if (findHTTP >= 0) |
| 345 |
HTTPString = tmpEntireString; |
| 346 |
} |
| 347 |
if (findSECURE == -1) { |
| 348 |
findSECURE = tmpEntireString.indexOf(secureString); |
| 349 |
if (findSECURE >= 0) |
| 350 |
SECUREString = tmpEntireString; |
| 351 |
} |
| 352 |
} |
| 353 |
} |
| 354 |
if (findSOCKS >= 0) { |
| 355 |
setBadProxySettings(true); |
| 356 |
setProxyError(SOCKS_SET); |
| 357 |
} |
| 358 |
else { |
| 359 |
if ((findHTTP >= 0) && (findSECURE == -1)) { |
| 360 |
setBadProxySettings(true); |
| 361 |
setProxyError(HTTP_PROXY_ONLY_SET); |
| 362 |
} |
| 363 |
else if ((findHTTP == -1) && (findSECURE >= 0 )) { |
| 364 |
setBadProxySettings(true); |
| 365 |
setProxyError(SECURE_PROXY_ONLY_SET); |
| 366 |
} |
| 367 |
else if ((findHTTP >= 0) && (findSECURE >= 0)) { |
| 368 |
// if two string equal - it is OK |
| 369 |
// if different - then ERROR |
| 370 |
// HTTPString=http=mdunnlinux:3128 |
| 371 |
// SECUREString=https=mdunnlinux:3128 |
| 372 |
// must first strip off up to '=' and then compare |
| 373 |
int httpEQUALS = HTTPString.indexOf("="); |
| 374 |
int secureEQUALS = SECUREString.indexOf("="); |
| 375 |
String tmpHTTP = HTTPString.substring(httpEQUALS+1); |
| 376 |
String tmpSECURE = SECUREString.substring(secureEQUALS+1); |
| 377 |
//if (HTTPString.equalsIgnoreCase(SECUREString)){ |
| 378 |
if (tmpHTTP.equalsIgnoreCase(tmpSECURE)){ |
| 379 |
if (tmpHTTP.startsWith("localhost")) { |
| 380 |
setBadProxySettings(true); |
| 381 |
setProxyError(HTTP_SECURE_LOCALHOST); |
| 382 |
} |
| 383 |
else { |
| 384 |
setBadProxySettings(false); |
| 385 |
setProxyError(PROXY_SETTINGS_OK); |
| 386 |
String tmpVal = ""; |
| 387 |
tmpVal = HTTPString.substring(findHTTP+httpString.length()); |
| 388 |
proxyString = tmpVal; |
| 389 |
} |
| 390 |
} |
| 391 |
else { |
| 392 |
//setBadProxySettings(true); |
| 393 |
//setProxyError(HTTP_SECURE_MISMATCH); |
| 394 |
// bugzilla 79219 mdd |
| 395 |
// https proxy different from http proxy |
| 396 |
setBadProxySettings(false); |
| 397 |
secureStringGlobal = tmpSECURE; |
| 398 |
setSSLProxyEnabled(true); |
| 399 |
setProxyError(PROXY_SETTINGS_OK); |
| 400 |
String tmpVal = ""; |
| 401 |
tmpVal = HTTPString.substring(findHTTP+httpString.length()); |
| 402 |
proxyString = tmpVal; |
| 403 |
} |
| 404 |
} |
| 405 |
} |
| 406 |
} |
| 407 |
// defect 82974 1/18/2005 |
| 408 |
else if (line.startsWith("\"ProxyOverride")) { |
| 409 |
setProxyOverrideEnabled(true); |
| 410 |
proxyOverrideString = findOverrideString(line); |
| 411 |
} |
| 412 |
else if (line.startsWith("\"AutoConfigURL")) { |
| 413 |
setAutoConfigURLEnabled(true); |
| 414 |
autoConfigURLString = findAutoConfigURLString(line); |
| 415 |
} |
| 416 |
} |
| 417 |
return proxyString; |
| 418 |
} |
| 419 |
|
| 420 |
/** |
| 421 |
* @param string |
| 422 |
*/ |
| 423 |
private String findOverrideString(String line) { |
| 424 |
// TODO Auto-generated method stub |
| 425 |
String returnStr = ""; |
| 426 |
String tmp="\"ProxyOverride"; |
| 427 |
String tmp2 = line.replaceAll("\"",""); |
| 428 |
String tmp3= tmp2.replaceAll("<",""); |
| 429 |
tmp3= tmp3.replaceAll(">",""); |
| 430 |
|
| 431 |
returnStr = tmp3.substring(tmp.length()); |
| 432 |
return returnStr; |
| 433 |
} |
| 434 |
|
| 435 |
private String findAutoConfigURLString(String line) { |
| 436 |
// TODO Auto-generated method stub |
| 437 |
String returnStr = ""; |
| 438 |
String tmp="\"AutoConfigURL"; |
| 439 |
String tmp2 = line.replaceAll("\"",""); |
| 440 |
String tmp3= tmp2.replaceAll("<",""); |
| 441 |
tmp3= tmp3.replaceAll(">",""); |
| 442 |
|
| 443 |
returnStr = tmp3.substring(tmp.length()); |
| 444 |
return returnStr; |
| 445 |
} |
| 446 |
public void setProxyType(String string) { |
| 447 |
proxyType = string; |
| 448 |
} |
| 449 |
/** |
| 450 |
* @return |
| 451 |
*/ |
| 452 |
public String getProxyType() { |
| 453 |
return proxyType; |
| 454 |
} |
| 455 |
|
| 456 |
/** |
| 457 |
* @param string |
| 458 |
*/ |
| 459 |
public void setProxyPort(String string) { |
| 460 |
proxyPort = string; |
| 461 |
} |
| 462 |
/** |
| 463 |
* @return |
| 464 |
*/ |
| 465 |
public String getProxyPort() { |
| 466 |
return proxyPort; |
| 467 |
} |
| 468 |
|
| 469 |
/** |
| 470 |
* @return |
| 471 |
*/ |
| 472 |
public boolean isProxyEnabled() { |
| 473 |
return isProxyEnabled; |
| 474 |
} |
| 475 |
|
| 476 |
/** |
| 477 |
* @param b |
| 478 |
*/ |
| 479 |
public void setProxyEnabled(boolean b) { |
| 480 |
isProxyEnabled = b; |
| 481 |
} |
| 482 |
|
| 483 |
/** |
| 484 |
* @return |
| 485 |
*/ |
| 486 |
public String getProxyAddr() { |
| 487 |
return proxyAddr; |
| 488 |
} |
| 489 |
|
| 490 |
/** |
| 491 |
* @param string |
| 492 |
*/ |
| 493 |
public void setProxyAddr(String string) { |
| 494 |
proxyAddr = string; |
| 495 |
} |
| 496 |
|
| 497 |
/** |
| 498 |
* @return Returns the badProxySettings. |
| 499 |
*/ |
| 500 |
public boolean isBadProxySettings() { |
| 501 |
return badProxySettings; |
| 502 |
} |
| 503 |
/** |
| 504 |
* @param badProxySettings The badProxySettings to set. |
| 505 |
*/ |
| 506 |
public void setBadProxySettings(boolean badProxySettings) { |
| 507 |
this.badProxySettings = badProxySettings; |
| 508 |
} |
| 509 |
/** |
| 510 |
* @return Returns the proxyError. |
| 511 |
*/ |
| 512 |
public int getProxyError() { |
| 513 |
return proxyError; |
| 514 |
} |
| 515 |
/** |
| 516 |
* @param proxyError The proxyError to set. |
| 517 |
*/ |
| 518 |
public void setProxyError(int proxyError) { |
| 519 |
this.proxyError = proxyError; |
| 520 |
} |
| 521 |
/** |
| 522 |
* @return Returns the sslProxyPort. |
| 523 |
*/ |
| 524 |
public String getSslProxyPort() { |
| 525 |
return sslProxyPort; |
| 526 |
} |
| 527 |
/** |
| 528 |
* @param sslProxyPort The sslProxyPort to set. |
| 529 |
*/ |
| 530 |
public void setSslProxyPort(String sslProxyPort) { |
| 531 |
this.sslProxyPort = sslProxyPort; |
| 532 |
} |
| 533 |
/** |
| 534 |
* @return Returns the sslProxy. |
| 535 |
*/ |
| 536 |
public String getSslProxyAddr() { |
| 537 |
return sslProxyAddr; |
| 538 |
} |
| 539 |
/** |
| 540 |
* @param sslProxy The sslProxy to set. |
| 541 |
*/ |
| 542 |
public void setSslProxyAddr(String sslProxy) { |
| 543 |
this.sslProxyAddr = sslProxy; |
| 544 |
} |
| 545 |
/** |
| 546 |
* @return Returns the isSSLProxyEnabled. |
| 547 |
*/ |
| 548 |
public boolean isSSLProxyEnabled() { |
| 549 |
return isSSLProxyEnabled; |
| 550 |
} |
| 551 |
/** |
| 552 |
* @param isSSLProxyEnabled The isSSLProxyEnabled to set. |
| 553 |
*/ |
| 554 |
public void setSSLProxyEnabled(boolean isSSLProxyEnabled) { |
| 555 |
this.isSSLProxyEnabled = isSSLProxyEnabled; |
| 556 |
} |
| 557 |
/** |
| 558 |
* @return Returns the isAutoConfigURLEnabled. |
| 559 |
*/ |
| 560 |
public boolean isAutoConfigURLEnabled() { |
| 561 |
return isAutoConfigURLEnabled; |
| 562 |
} |
| 563 |
/** |
| 564 |
* @param isAutoConfigURLEnabled The isAutoConfigURLEnabled to set. |
| 565 |
*/ |
| 566 |
public void setAutoConfigURLEnabled(boolean isAutoConfigURLEnabled) { |
| 567 |
this.isAutoConfigURLEnabled = isAutoConfigURLEnabled; |
| 568 |
} |
| 569 |
|
| 570 |
/** |
| 571 |
* @return Returns the isProxyOverrideEnabled. |
| 572 |
*/ |
| 573 |
public boolean isProxyOverrideEnabled() { |
| 574 |
return isProxyOverrideEnabled; |
| 575 |
} |
| 576 |
/** |
| 577 |
* @param isProxyOverrideEnabled The isProxyOverrideEnabled to set. |
| 578 |
*/ |
| 579 |
public void setProxyOverrideEnabled(boolean isProxyOverrideEnabled) { |
| 580 |
this.isProxyOverrideEnabled = isProxyOverrideEnabled; |
| 581 |
} |
| 582 |
/** |
| 583 |
* @return Returns the autoConfigURLString. |
| 584 |
*/ |
| 585 |
public String getAutoConfigURLString() { |
| 586 |
return autoConfigURLString; |
| 587 |
} |
| 588 |
/** |
| 589 |
* @param autoConfigURLString The autoConfigURLString to set. |
| 590 |
*/ |
| 591 |
public void setAutoConfigURLString(String autoConfigURLString) { |
| 592 |
this.autoConfigURLString = autoConfigURLString; |
| 593 |
} |
| 594 |
/** |
| 595 |
* @return Returns the proxyOverrideString. |
| 596 |
*/ |
| 597 |
public String getProxyOverrideString() { |
| 598 |
return proxyOverrideString; |
| 599 |
} |
| 600 |
/** |
| 601 |
* @param proxyOverrideString The proxyOverrideString to set. |
| 602 |
*/ |
| 603 |
public void setProxyOverrideString(String proxyOverrideString) { |
| 604 |
this.proxyOverrideString = proxyOverrideString; |
| 605 |
} |
| 606 |
public String getTempPath() |
| 607 |
{ |
| 608 |
String theTmpPath = ""; |
| 609 |
IPath baseLoc = Platform.getLocation(); |
| 610 |
String newtpath = baseLoc.toOSString(); |
| 611 |
|
| 612 |
theTmpPath = newtpath; |
| 613 |
return theTmpPath; |
| 614 |
} |
| 615 |
} |