Class NetworkSettings
java.lang.Object
org.openide.util.NetworkSettings
Useful static methods for getting Network Proxy required for make network
connection for specified resource.
- Since:
- 8.13
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAllows NetBeans Platform users to provide own proxy and network credentials separately. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic char[]Returns thepasswordfor Proxy Authentication.static StringReturns theusernamefor Proxy Authentication.static StringDeprecated.static StringgetProxyHost(URI u) Returns thehostnamepart of network proxy address based on given URI to access the resource at.static StringgetProxyPort(URI u) Returns theportpart of network proxy address based on given URI to access the resource at.static booleanA utility method for implementations ofAuthenticatorto suppress asking users a authentication question while running code posted in#authenticationDialogSuppressed.static <R> RsuppressAuthenticationDialog(Callable<R> blockOfCode) Suppress asking user a question about the authentication credentials while runningblockOfCode.
-
Constructor Details
-
NetworkSettings
public NetworkSettings()
-
-
Method Details
-
getProxyHost
-
getProxyPort
-
getAuthenticationUsername
-
getAuthenticationPassword
Returns thepasswordfor Proxy Authentication. Returnsnullif no authentication required.- Parameters:
u- The URI that a connection is required to- Returns:
- password for Proxy Authentication
- Since:
- 9.8
-
getKeyForAuthenticationPassword
Deprecated.usegetAuthenticationPassword(java.net.URI)insteadReturns thekeyfor reading password for Proxy Authentication. Useorg.netbeans.api.keyring.Keyringfor reading the password from the ring. Returnsnullif no authentication required.- Parameters:
u- The URI that a connection is required to- Returns:
- the key for reading password for Proxy Authentication from the ring or
null
-
suppressAuthenticationDialog
Suppress asking user a question about the authentication credentials while runningblockOfCode. It's a contract with NetBeans implementation ofAuthenticator. In case a system is using other Authenticator implementation, it must callisAuthenticationDialogSuppressed()method. -
isAuthenticationDialogSuppressed
public static boolean isAuthenticationDialogSuppressed()A utility method for implementations ofAuthenticatorto suppress asking users a authentication question while running code posted in#authenticationDialogSuppressed.- Returns:
- true while running code posted in
#authenticationDialogSuppressedmethod. - Since:
- 8.17
- See Also:
-
getAuthenticationPassword(java.net.URI)instead