# NetBeans IDE HG Patch # This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /work/src/netbeans-jm # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: openide.util.ui/apichanges.xml --- openide.util.ui/apichanges.xml +++ openide.util.ui/apichanges.xml @@ -51,6 +51,24 @@ Actions API + + + API NetworkSettings.getAuthenticationPassword added + + + + + +

+ The SPI + NetworkSettings.ProxyCredentialsProvider allows NetBeans Platform + users to provide proxy and network credentials, but it should do so also for + the password, not only username. +

+
+ + +
Desktop independent utilities extracted Index: openide.util.ui/manifest.mf --- openide.util.ui/manifest.mf +++ openide.util.ui/manifest.mf @@ -1,5 +1,5 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.util.ui OpenIDE-Module-Localizing-Bundle: org/openide/util/Bundle.properties -OpenIDE-Module-Specification-Version: 9.7 +OpenIDE-Module-Specification-Version: 9.8 Index: openide.util.ui/src/org/openide/util/NetworkSettings.java --- openide.util.ui/src/org/openide/util/NetworkSettings.java +++ openide.util.ui/src/org/openide/util/NetworkSettings.java @@ -44,6 +44,7 @@ import java.net.Authenticator; import java.net.URI; import java.util.concurrent.Callable; +import java.util.logging.Level; import java.util.logging.Logger; /** Useful static methods for getting Network Proxy required for make network @@ -105,12 +106,31 @@ return null; } + /** Returns the password for Proxy Authentication. + * Returns null if no authentication required. + * + * @param u The URI that a connection is required to + * @return password for Proxy Authentication + * @since 9.8 + */ + public static char[] getAuthenticationPassword(URI u) { + ProxyCredentialsProvider provider = Lookup.getDefault().lookup(ProxyCredentialsProvider.class); + if (provider == null) { + LOGGER.log(Level.WARNING, "No ProxyCredentialsProvider found in lookup {0} thus no proxy information will provide!", Lookup.getDefault()); + } + if (provider != null && provider.isProxyAuthentication(u)) { + return provider.getProxyPassword(u); + } + return null; + } + /** Returns the key for reading password for Proxy Authentication. * Use org.netbeans.api.keyring.Keyring for reading the password from the ring. * Returns null if no authentication required. * * @param u The URI that a connection is required to * @return the key for reading password for Proxy Authentication from the ring or null + * @deprecated use {@link #getAuthenticationPassword(java.net.URI)} instead */ public static String getKeyForAuthenticationPassword(URI u) { ProxyCredentialsProvider provider = Lookup.getDefault().lookup(ProxyCredentialsProvider.class);