private String downloadPacContent(String url) throws IOException {
  if (url == null) {
    throw new IOException("Invalid PAC script URL: null");
  }
  setPacProxySelectorEnabled(false);
  HttpURLConnection con=null;
  try {
    con=setupHTTPConnection(url);
    if (con.getResponseCode() != 200) {
      throw new IOException("Server returned: " + con.getResponseCode() + " "+ con.getResponseMessage());
    }
    this.expireAtMillis=con.getExpiration();
    BufferedReader r=getReader(con);
    String result=readAllContent(r);
    r.close();
    return result;
  }
  finally {
    setPacProxySelectorEnabled(true);
    if (con != null) {
      con.disconnect();
    }
  }
}

private String downloadPacContent ( String url ) throws IOException { if ( url == null ) { throw new IOException ( "Invalid PAC script URL: null" ) ; } setPacProxySelectorEnabled ( false ) ; HttpURLConnection con = null ; try { con = setupHTTPConnection ( url ) ; if ( con . getResponseCode ( ) != 200 ) { throw new IOException ( "Server returned: " + con . getResponseCode ( ) + " " + con . getResponseMessage ( ) ) ; } this . expireAtMillis = con . getExpiration ( ) ; BufferedReader r = getReader ( con ) ; String result = readAllContent ( r ) ; r . close ( ) ; return result ; } finally { setPacProxySelectorEnabled ( true ) ; if ( con != null ) { con . disconnect ( ) ; } } }
downloads the script from a webserver .
