Class ProxyManager


  • public class ProxyManager
    extends Object
    • Field Detail

      • isSystemProxyUnset

        private static final boolean isSystemProxyUnset
      • defaultProxySelector

        private final ProxySelector defaultProxySelector
    • Constructor Detail

      • ProxyManager

        public ProxyManager()
    • Method Detail

      • isProxyEnabled

        public boolean isProxyEnabled()
      • applyProxy

        public void applyProxy()
      • resetProxy

        public void resetProxy()
      • getSystemProxy

        private ProxyInfo getSystemProxy()
      • getProxyFromProgramArgument

        private static ProxyInfo getProxyFromProgramArgument​(String prefix)
      • createHttpProxy

        private static Proxy createHttpProxy​(String httpProxyHost,
                                             Integer httpProxyPort)
      • getSystemProxyInner

        private static ProxyInfo getSystemProxyInner()
      • shouldNotUseProxyFor

        private static boolean shouldNotUseProxyFor​(Pattern pattern,
                                                    String urlhost)
        refer sun.net.spi.DefaultProxySelector
        Returns:
        true if given this pattern for non-proxy hosts and this urlhost the proxy should NOT be used to access this urlhost
      • toPattern

        private static Pattern toPattern​(String mask)
        refer to sun.net.spi.DefaultProxySelector
        Parameters:
        mask - non-null mask
        Returns:
        Pattern corresponding to this mask or null in case mask should not match anything
      • disjunctToRegex

        private static String disjunctToRegex​(String disjunct)
        refer to sun.net.spi.DefaultProxySelector
        Parameters:
        disjunct - non-null mask disjunct
        Returns:
        java regex string corresponding to this mask