|
Lines 17-41
Link Here
|
| 17 |
import java.util.List; |
17 |
import java.util.List; |
| 18 |
import java.util.Properties; |
18 |
import java.util.Properties; |
| 19 |
|
19 |
|
|
|
20 |
import org.eclipse.core.internal.net.auth.ProxyAuthenticator; |
| 20 |
import org.eclipse.core.net.proxy.IProxyChangeEvent; |
21 |
import org.eclipse.core.net.proxy.IProxyChangeEvent; |
| 21 |
import org.eclipse.core.net.proxy.IProxyChangeListener; |
22 |
import org.eclipse.core.net.proxy.IProxyChangeListener; |
| 22 |
import org.eclipse.core.net.proxy.IProxyData; |
23 |
import org.eclipse.core.net.proxy.IProxyData; |
| 23 |
import org.eclipse.core.net.proxy.IProxyService; |
24 |
import org.eclipse.core.net.proxy.IProxyService; |
| 24 |
import org.eclipse.core.runtime.Assert; |
25 |
import org.eclipse.core.runtime.Assert; |
| 25 |
import org.eclipse.core.runtime.CoreException; |
|
|
| 26 |
import org.eclipse.core.runtime.IConfigurationElement; |
| 27 |
import org.eclipse.core.runtime.IExtension; |
| 28 |
import org.eclipse.core.runtime.ISafeRunnable; |
26 |
import org.eclipse.core.runtime.ISafeRunnable; |
| 29 |
import org.eclipse.core.runtime.IStatus; |
|
|
| 30 |
import org.eclipse.core.runtime.ListenerList; |
27 |
import org.eclipse.core.runtime.ListenerList; |
| 31 |
import org.eclipse.core.runtime.RegistryFactory; |
|
|
| 32 |
import org.eclipse.core.runtime.SafeRunner; |
28 |
import org.eclipse.core.runtime.SafeRunner; |
| 33 |
import org.eclipse.core.runtime.preferences.ConfigurationScope; |
29 |
import org.eclipse.core.runtime.preferences.ConfigurationScope; |
| 34 |
import org.eclipse.core.runtime.preferences.IEclipsePreferences; |
30 |
import org.eclipse.core.runtime.preferences.IEclipsePreferences; |
| 35 |
import org.eclipse.core.runtime.preferences.InstanceScope; |
31 |
import org.eclipse.core.runtime.preferences.InstanceScope; |
| 36 |
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; |
32 |
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; |
| 37 |
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; |
33 |
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; |
| 38 |
import org.eclipse.osgi.util.NLS; |
|
|
| 39 |
import org.osgi.service.prefs.BackingStoreException; |
34 |
import org.osgi.service.prefs.BackingStoreException; |
| 40 |
import org.osgi.service.prefs.Preferences; |
35 |
import org.osgi.service.prefs.Preferences; |
| 41 |
|
36 |
|
|
Lines 281-287
Link Here
|
| 281 |
ProxyType type = proxies[i]; |
276 |
ProxyType type = proxies[i]; |
| 282 |
type.initialize(); |
277 |
type.initialize(); |
| 283 |
} |
278 |
} |
| 284 |
registerAuthenticator(); |
279 |
ProxyAuthenticator a = new ProxyAuthenticator(); |
|
|
280 |
Authenticator.setDefault(a); |
| 285 |
} |
281 |
} |
| 286 |
|
282 |
|
| 287 |
public IProxyData getProxyData(String type) { |
283 |
public IProxyData getProxyData(String type) { |
|
Lines 378-411
Link Here
|
| 378 |
} |
374 |
} |
| 379 |
return null; |
375 |
return null; |
| 380 |
} |
376 |
} |
| 381 |
|
|
|
| 382 |
private void registerAuthenticator() { |
| 383 |
Authenticator a = getPluggedInAuthenticator(); |
| 384 |
if (a != null) { |
| 385 |
Authenticator.setDefault(a); |
| 386 |
} |
| 387 |
} |
| 388 |
|
| 389 |
private Authenticator getPluggedInAuthenticator() { |
| 390 |
IExtension[] extensions = RegistryFactory.getRegistry().getExtensionPoint(Activator.ID, Activator.PT_AUTHENTICATOR).getExtensions(); |
| 391 |
if (extensions.length == 0) |
| 392 |
return null; |
| 393 |
IExtension extension = extensions[0]; |
| 394 |
IConfigurationElement[] configs = extension.getConfigurationElements(); |
| 395 |
if (configs.length == 0) { |
| 396 |
Activator.log(IStatus.ERROR, NLS.bind("Authenticator {0} is missing required fields", (new Object[] {extension.getUniqueIdentifier()})), null);//$NON-NLS-1$ |
| 397 |
return null; |
| 398 |
} |
| 399 |
try { |
| 400 |
IConfigurationElement config = configs[0]; |
| 401 |
return (Authenticator) config.createExecutableExtension("class");//$NON-NLS-1$ |
| 402 |
} catch (CoreException ex) { |
| 403 |
Activator.log(IStatus.ERROR, NLS.bind("Unable to instantiate authenticator {0}", (new Object[] {extension.getUniqueIdentifier()})), ex);//$NON-NLS-1$ |
| 404 |
return null; |
| 405 |
} |
| 406 |
} |
| 407 |
|
377 |
|
| 408 |
|
|
|
| 409 |
private synchronized void checkMigrated() { |
378 |
private synchronized void checkMigrated() { |
| 410 |
if (migrated || !Activator.getInstance().instanceLocationAvailable()) |
379 |
if (migrated || !Activator.getInstance().instanceLocationAvailable()) |
| 411 |
return; |
380 |
return; |