HttpConfigurable 类在 2024.2 版本已被弃用,当我使用 HttpConfigurable.getInstance() 获取主机、登录名等代理数据时,会警告:'com.智能。实用程序。网。 HttpConfigurable' 已弃用并标记为删除。还有其他方法获取代理数据吗?
我尝试按照https://intellij-support.jetbrains.com/hc/en-us/community/posts/206755245-How-to-access-IntelliJ-proxy-data-programmatically所说,但编译时显示警告: 警告:[删除] com.intellij.util.net 中的 HttpConfigurable 已弃用并标记为删除 HttpConfigurable proxySettings = HttpConfigurable.getInstance();
HttpConfigurable
中的文档请您参考具体方法的弃用通知:
/** * @deprecated Use {@link ProxySettings}, {@link ProxyAuthentication}, {@link HttpConnectionUtils}, and {@link ProxyUtils} instead. * See method deprecation notices for more details. * <p/> * For removal in version 24.3 */
getProxyLogin()
的文档,您应该使用 ProxyUtils#getStaticProxyCredentials
的版本。
/** @deprecated use {@link ProxyUtils#getStaticProxyCredentials(ProxySettings, ProxyCredentialProvider)} or {@link ProxyUtils#setStaticProxyCredentials(ProxySettings, ProxyCredentialStore, Credentials, boolean)} */ @Deprecated(forRemoval = true) @Transient public @Nullable String getProxyLogin() { return getSecure("proxy.login"); }