_port = Controller.getInstance().getPreferenceStore().getInt(PreferenceConstants.PROXY_PORT);
_username = Controller.getInstance().getPreferenceStore().getString(PreferenceConstants.PROXY_USERNAME);
_password = Controller.getInstance().getPreferenceStore().getString(PreferenceConstants.PROXY_PASSWORD);
if (proxyType.equals(Proxy.Type.HTTP.toString())) {
_proxy = new Proxy(Proxy.Type.HTTP, new Socket(_url, _port).getRemoteSocketAddress());
} else if (proxyType.equals(Proxy.Type.SOCKS.toString())) {
_proxy = new Proxy(Proxy.Type.SOCKS, new Socket(_url, _port).getRemoteSocketAddress());
}
}
} catch (UnknownHostException e) {
Log.getInstance(NetworkManager.class).warn("Error while creating proxy (UnknownHostException): " + e.getStackTrace());