Lines 44-49
Link Here
|
44 |
import java.net.Authenticator; |
44 |
import java.net.Authenticator; |
45 |
import java.net.URI; |
45 |
import java.net.URI; |
46 |
import java.util.concurrent.Callable; |
46 |
import java.util.concurrent.Callable; |
|
|
47 |
import java.util.logging.Level; |
47 |
import java.util.logging.Logger; |
48 |
import java.util.logging.Logger; |
48 |
|
49 |
|
49 |
/** Useful static methods for getting Network Proxy required for make network |
50 |
/** Useful static methods for getting Network Proxy required for make network |
Lines 105-116
Link Here
|
105 |
return null; |
106 |
return null; |
106 |
} |
107 |
} |
107 |
|
108 |
|
|
|
109 |
/** Returns the <code>password</code> for Proxy Authentication. |
110 |
* Returns <code>null</code> if no authentication required. |
111 |
* |
112 |
* @param u The URI that a connection is required to |
113 |
* @return password for Proxy Authentication |
114 |
* @since 9.8 |
115 |
*/ |
116 |
public static char[] getAuthenticationPassword(URI u) { |
117 |
ProxyCredentialsProvider provider = Lookup.getDefault().lookup(ProxyCredentialsProvider.class); |
118 |
if (provider == null) { |
119 |
LOGGER.log(Level.WARNING, "No ProxyCredentialsProvider found in lookup {0} thus no proxy information will provide!", Lookup.getDefault()); |
120 |
} |
121 |
if (provider != null && provider.isProxyAuthentication(u)) { |
122 |
return provider.getProxyPassword(u); |
123 |
} |
124 |
return null; |
125 |
} |
126 |
|
108 |
/** Returns the <code>key</code> for reading password for Proxy Authentication. |
127 |
/** Returns the <code>key</code> for reading password for Proxy Authentication. |
109 |
* Use <a href="@org-netbeans-modules-keyring@/org/netbeans/api/keyring/Keyring.html"><code>org.netbeans.api.keyring.Keyring</code></a> for reading the password from the ring. |
128 |
* Use <a href="@org-netbeans-modules-keyring@/org/netbeans/api/keyring/Keyring.html"><code>org.netbeans.api.keyring.Keyring</code></a> for reading the password from the ring. |
110 |
* Returns <code>null</code> if no authentication required. |
129 |
* Returns <code>null</code> if no authentication required. |
111 |
* |
130 |
* |
112 |
* @param u The URI that a connection is required to |
131 |
* @param u The URI that a connection is required to |
113 |
* @return the key for reading password for Proxy Authentication from the ring or <code>null</code> |
132 |
* @return the key for reading password for Proxy Authentication from the ring or <code>null</code> |
|
|
133 |
* @deprecated use {@link #getAuthenticationPassword(java.net.URI)} instead |
114 |
*/ |
134 |
*/ |
115 |
public static String getKeyForAuthenticationPassword(URI u) { |
135 |
public static String getKeyForAuthenticationPassword(URI u) { |
116 |
ProxyCredentialsProvider provider = Lookup.getDefault().lookup(ProxyCredentialsProvider.class); |
136 |
ProxyCredentialsProvider provider = Lookup.getDefault().lookup(ProxyCredentialsProvider.class); |