@Override public List<Proxy> select(URI uri){
  ArrayList<Proxy> proxies=new ArrayList<Proxy>();
  if (pacScript == null) {
    try {
      pacScript=compilePacScript(loadPacScript(pacUrl));
    }
 catch (    PacProxyException ex) {
      ex.printStackTrace();
      proxies.add(Proxy.NO_PROXY);
      return proxies;
    }
  }
  String pacFunctionReturn=null;
  try {
    pacFunctionReturn=(String)pacScript.invokeFunction("FindProxyForURL",uri.toString(),uri.getHost());
  }
 catch (  NoSuchMethodException ex) {
    ex.printStackTrace();
    proxies.add(Proxy.NO_PROXY);
    return proxies;
  }
catch (  ScriptException ex) {
    ex.printStackTrace();
    proxies.add(Proxy.NO_PROXY);
    return proxies;
  }
  if (pacFunctionReturn == null) {
    proxies.add(Proxy.NO_PROXY);
    return proxies;
  }
  proxies.addAll(parsePacProxies(pacFunctionReturn));
  if (proxies.size() == 0) {
    proxies.add(Proxy.NO_PROXY);
  }
  return proxies;
}

@ Override public List < Proxy > select ( URI uri ) { ArrayList < Proxy > proxies = new ArrayList < Proxy > ( ) ; if ( pacScript == null ) { try { pacScript = compilePacScript ( loadPacScript ( pacUrl ) ) ; } catch ( PacProxyException ex ) { ex . printStackTrace ( ) ; proxies . add ( Proxy . NO_PROXY ) ; return proxies ; } } String pacFunctionReturn = null ; try { pacFunctionReturn = ( String ) pacScript . invokeFunction ( "FindProxyForURL" , uri . toString ( ) , uri . getHost ( ) ) ; } catch ( NoSuchMethodException ex ) { ex . printStackTrace ( ) ; proxies . add ( Proxy . NO_PROXY ) ; return proxies ; } catch ( ScriptException ex ) { ex . printStackTrace ( ) ; proxies . add ( Proxy . NO_PROXY ) ; return proxies ; } if ( pacFunctionReturn == null ) { proxies . add ( Proxy . NO_PROXY ) ; return proxies ; } proxies . addAll ( parsePacProxies ( pacFunctionReturn ) ) ; if ( proxies . size ( ) == 0 ) { proxies . add ( Proxy . NO_PROXY ) ; } return proxies ; }
get a list of proxies for the supplied uri .
