public class HttpConfigurable extends java.lang.Object implements PersistentStateComponent<HttpConfigurable>, Disposable
Modifier and Type | Class and Description |
---|---|
static class |
HttpConfigurable.ProxyInfo |
Disposable.Parent
Modifier and Type | Field and Description |
---|---|
boolean |
AUTHENTICATION_CANCELLED |
static int |
CONNECTION_TIMEOUT
Deprecated.
|
boolean |
KEEP_PROXY_PASSWORD |
java.lang.String |
LAST_ERROR |
Getter<java.net.PasswordAuthentication> |
myTestAuthRunnable |
Getter<java.net.PasswordAuthentication> |
myTestGenericAuthRunnable |
java.lang.String |
PAC_URL |
boolean |
PROXY_AUTHENTICATION |
java.lang.String |
PROXY_EXCEPTIONS |
java.lang.String |
PROXY_HOST |
int |
PROXY_PORT |
boolean |
PROXY_TYPE_IS_SOCKS |
static int |
READ_TIMEOUT
Deprecated.
|
static int |
REDIRECT_LIMIT
Deprecated.
|
boolean |
USE_HTTP_PROXY |
boolean |
USE_PAC_URL |
boolean |
USE_PROXY_PAC |
Constructor and Description |
---|
HttpConfigurable() |
Modifier and Type | Method and Description |
---|---|
void |
clearGenericPasswords() |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
static boolean |
editConfigurable(javax.swing.JComponent parent) |
java.net.PasswordAuthentication |
getGenericPassword(java.lang.String host,
int port) |
java.net.PasswordAuthentication |
getGenericPromptedAuthentication(java.lang.String prefix,
java.lang.String host,
java.lang.String prompt,
int port,
boolean remember) |
static HttpConfigurable |
getInstance() |
java.util.List<Pair<java.lang.String,java.lang.String>> |
getJvmProperties(boolean withAutodetection,
java.net.URI uri) |
static java.util.List<KeyValue<java.lang.String,java.lang.String>> |
getJvmPropertiesList(boolean withAutodetection,
java.net.URI uri)
Deprecated.
|
java.net.ProxySelector |
getOnlyBySettingsSelector() |
java.lang.String |
getPlainProxyPassword() |
java.net.PasswordAuthentication |
getPromptedAuthentication(java.lang.String host,
java.lang.String prompt) |
java.lang.String |
getProxyLogin() |
HttpConfigurable |
getState() |
void |
initComponent()
Deprecated.
|
void |
initializeComponent()
If class also is a component, then this method will be called after loading state (even if not state) but only once throughout the life cycle
|
boolean |
isGenericPasswordCanceled(java.lang.String host,
int port) |
boolean |
isHttpProxyEnabledForUrl(java.lang.String url) |
boolean |
isProxyException(java.lang.String uriHost) |
boolean |
isProxyException(java.net.URI uri) |
static boolean |
isRealProxy(java.net.Proxy proxy) |
void |
loadState(HttpConfigurable state)
This method is called when new component state is loaded.
|
void |
noStateLoaded()
This method is called when the component is initialized, but no state is persisted.
|
java.net.URLConnection |
openConnection(java.lang.String location) |
java.net.HttpURLConnection |
openHttpConnection(java.lang.String location)
Opens HTTP connection to a given location using configured http proxy settings.
|
void |
prepareURL(java.lang.String url)
todo [all] It is NOT necessary to call anything if you obey common IDE proxy settings;
todo if you want to define your own behaviour, refer to
CommonProxy
Also, this method is useful in a way that it tests connection to the host [through proxy]. |
void |
putGenericPassword(java.lang.String host,
int port,
java.net.PasswordAuthentication authentication,
boolean remember) |
void |
readExternal(Element element)
Deprecated.
left for compatibility with com.intellij.openapi.project.impl.IdeaServerSettings
|
void |
removeGeneric(CommonProxy.HostInfo info) |
void |
setGenericPasswordCanceled(java.lang.String host,
int port) |
void |
setPlainProxyPassword(java.lang.String password) |
void |
setProxyLogin(java.lang.String login) |
void |
writeExternal(Element element)
Deprecated.
left for compatibility with com.intellij.openapi.project.impl.IdeaServerSettings
|
public boolean PROXY_TYPE_IS_SOCKS
public boolean USE_HTTP_PROXY
public boolean USE_PROXY_PAC
public transient volatile boolean AUTHENTICATION_CANCELLED
public java.lang.String PROXY_HOST
public int PROXY_PORT
public volatile boolean PROXY_AUTHENTICATION
public boolean KEEP_PROXY_PASSWORD
public transient java.lang.String LAST_ERROR
public java.lang.String PROXY_EXCEPTIONS
public boolean USE_PAC_URL
public java.lang.String PAC_URL
public transient Getter<java.net.PasswordAuthentication> myTestAuthRunnable
public transient Getter<java.net.PasswordAuthentication> myTestGenericAuthRunnable
@Deprecated public static final int CONNECTION_TIMEOUT
HttpRequests.CONNECTION_TIMEOUT
@Deprecated public static final int READ_TIMEOUT
HttpRequests.READ_TIMEOUT
@Deprecated public static final int REDIRECT_LIMIT
HttpRequests.REDIRECT_LIMIT
public static HttpConfigurable getInstance()
public static boolean editConfigurable(javax.swing.JComponent parent)
public HttpConfigurable getState()
getState
in interface PersistentStateComponent<HttpConfigurable>
null
value indicates
that the returned state won't be stored, as a result previously stored state will be used.XmlSerializer
public void noStateLoaded()
PersistentStateComponent
noStateLoaded
in interface PersistentStateComponent<HttpConfigurable>
public void initializeComponent()
PersistentStateComponent
initializeComponent
in interface PersistentStateComponent<HttpConfigurable>
@Deprecated public void initComponent()
initializeComponent()
public java.net.ProxySelector getOnlyBySettingsSelector()
public void dispose()
Disposable
dispose
in interface Disposable
public void loadState(HttpConfigurable state)
PersistentStateComponent
State object should be used directly, defensive copying is not required.
loadState
in interface PersistentStateComponent<HttpConfigurable>
state
- loaded component stateXmlSerializerUtil.copyBean(Object, Object)
public boolean isGenericPasswordCanceled(java.lang.String host, int port)
public void setGenericPasswordCanceled(java.lang.String host, int port)
public java.net.PasswordAuthentication getGenericPassword(java.lang.String host, int port)
public void putGenericPassword(java.lang.String host, int port, java.net.PasswordAuthentication authentication, boolean remember)
public java.lang.String getProxyLogin()
public void setProxyLogin(java.lang.String login)
public java.lang.String getPlainProxyPassword()
public void setPlainProxyPassword(java.lang.String password)
public java.net.PasswordAuthentication getGenericPromptedAuthentication(java.lang.String prefix, java.lang.String host, java.lang.String prompt, int port, boolean remember)
public java.net.PasswordAuthentication getPromptedAuthentication(java.lang.String host, java.lang.String prompt)
@Deprecated public void readExternal(Element element) throws InvalidDataException
InvalidDataException
@Deprecated public void writeExternal(Element element) throws WriteExternalException
WriteExternalException
public void prepareURL(java.lang.String url) throws java.io.IOException
CommonProxy
Also, this method is useful in a way that it tests connection to the host [through proxy].url
- URL for HTTP connectionjava.io.IOException
public java.net.URLConnection openConnection(java.lang.String location) throws java.io.IOException
java.io.IOException
public java.net.HttpURLConnection openHttpConnection(java.lang.String location) throws java.io.IOException
location
- url to connect toHttpURLConnection
java.io.IOException
- in case of any I/O troubles or if created connection isn't instance of HttpURLConnection.public boolean isHttpProxyEnabledForUrl(java.lang.String url)
public java.util.List<Pair<java.lang.String,java.lang.String>> getJvmProperties(boolean withAutodetection, java.net.URI uri)
public boolean isProxyException(java.net.URI uri)
public boolean isProxyException(java.lang.String uriHost)
public static boolean isRealProxy(java.net.Proxy proxy)
public void clearGenericPasswords()
public void removeGeneric(CommonProxy.HostInfo info)
@Deprecated public static java.util.List<KeyValue<java.lang.String,java.lang.String>> getJvmPropertiesList(boolean withAutodetection, java.net.URI uri)
getJvmProperties(boolean, URI)