This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 268803
Collapse All | Expand All

(-)openide.util.ui/apichanges.xml (+18 lines)
Lines 51-56 Link Here
51
    <apidef name="actions">Actions API</apidef>
51
    <apidef name="actions">Actions API</apidef>
52
</apidefs>
52
</apidefs>
53
<changes>
53
<changes>
54
    <change id="GetAuthenticationPassword">
55
        <api name="util"/>
56
        <summary>API <code>NetworkSettings.getAuthenticationPassword</code> added</summary>
57
        <version major="9" minor="8"/>
58
        <date day="3" month="11" year="2016"/>
59
        <author login="tstupka"/>
60
        <compatibility addition="yes"/>
61
        <description>
62
            <p>
63
                The SPI <a href="@TOP@/org/openide/util/NetworkSettings.ProxyCredentialsProvider.html">
64
                NetworkSettings.ProxyCredentialsProvider</a> allows NetBeans Platform
65
                users to provide proxy and network credentials, but it should do so also for 
66
                the password, not only username.                
67
            </p>
68
        </description>
69
        <class package="org.openide.util" name="NetworkSettings"/>
70
        <issue number="268803"/>
71
    </change>
54
    <change id="server.is.free">
72
    <change id="server.is.free">
55
        <api name="util"/>
73
        <api name="util"/>
56
        <summary>Desktop independent utilities extracted</summary>
74
        <summary>Desktop independent utilities extracted</summary>
(-)openide.util.ui/manifest.mf (-1 / +1 lines)
Lines 1-5 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.openide.util.ui
2
OpenIDE-Module: org.openide.util.ui
3
OpenIDE-Module-Localizing-Bundle: org/openide/util/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/openide/util/Bundle.properties
4
OpenIDE-Module-Specification-Version: 9.7
4
OpenIDE-Module-Specification-Version: 9.8
5
5
(-)openide.util.ui/src/org/openide/util/NetworkSettings.java (+20 lines)
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);

Return to bug 268803