public static File makeProxyPAC(File parentDir, int port, String configuredProxy, String proxyPort, String nonProxyHosts, Capabilities capabilities)
throws FileNotFoundException {
DoNotUseProxyPac pac = newProxyPac(port, configuredProxy, proxyPort, nonProxyHosts, capabilities);
Proxy proxy = extractProxy(capabilities);
if (proxy != null && proxy.getHttpProxy() != null) {
pac.defaults().toProxy(proxy.getHttpProxy());
}
try {
File pacFile = new File(parentDir, "proxy.pac");
Writer out = new FileWriter(pacFile);