public final class NetworkSettings
extends java.lang.Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
NetworkSettings.ProxyCredentialsProvider |
Allows
NetBeans Platform users to provide own proxy and network credentials separately.
|
| Constructor | Description |
|---|---|
NetworkSettings() |
| Modifier and Type | Method | Description |
|---|---|---|
static java.lang.String |
getAuthenticationUsername(java.net.URI u) |
Returns the
username for Proxy Authentication. |
static java.lang.String |
getKeyForAuthenticationPassword(java.net.URI u) |
Returns the
key for reading password for Proxy Authentication. |
static java.lang.String |
getProxyHost(java.net.URI u) |
Returns the
hostname part of network proxy address
based on given URI to access the resource at. |
static java.lang.String |
getProxyPort(java.net.URI u) |
Returns the
port part of network proxy address
based on given URI to access the resource at. |
static boolean |
isAuthenticationDialogSuppressed() |
A utility method for implementations of
Authenticator
to suppress asking users a authentication question while running code posted
in authenticationDialogSuppressed. |
static <R> R |
suppressAuthenticationDialog(java.util.concurrent.Callable<R> blockOfCode) |
Suppress asking user a question about the authentication credentials while
running
blockOfCode. |
public static java.lang.String getProxyHost(java.net.URI u)
hostname part of network proxy address
based on given URI to access the resource at.
Returns null for direct connection.u - The URI that a connection is required tonullpublic static java.lang.String getProxyPort(java.net.URI u)
port part of network proxy address
based on given URI to access the resource at.
Returns null for direct connection.u - The URI that a connection is required tonullpublic static java.lang.String getAuthenticationUsername(java.net.URI u)
username for Proxy Authentication.
Returns null if no authentication required.u - The URI that a connection is required tonullpublic static java.lang.String getKeyForAuthenticationPassword(java.net.URI u)
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.u - The URI that a connection is required tonullpublic static <R> R suppressAuthenticationDialog(java.util.concurrent.Callable<R> blockOfCode)
throws java.lang.Exception
blockOfCode. It's a contract with NetBeans implementation
of Authenticator.
In case a system is using other Authenticator implementation, it must call isAuthenticationDialogSuppressed() method.blockOfCode - Callable containing code which will be executed while authentication is suppressedblockOfCode and may throw an exception.java.lang.ExceptionisAuthenticationDialogSuppressed()public static boolean isAuthenticationDialogSuppressed()
Authenticator
to suppress asking users a authentication question while running code posted
in authenticationDialogSuppressed.authenticationDialogSuppressed method.authenticationDialogSuppressedBuilt on April 24 2018. | Portions Copyright 1997-2018 Oracle. All rights reserved.