import org.tizen.emulator.manager.vms.VMProperty;
import org.tizen.emulator.manager.vms.helper.HelperClass;
import org.tizen.emulator.manager.vms.helper.ProcessResult;
+import org.tizen.emulator.manager.vms.helper.VMLauncherException;
import org.tizen.emulator.manager.vms.helper.VMWorkerException;
public class NetProxyOption extends Option {
- public static String hostProxy = "";
+ public static String hostProxy;
public static final String PROXY_COMMENT = "# network_proxy : use host's proxy configuration\n"
+ "# (only if VM's proxy option is set as using host proxy)";
- static {
- try {
- hostProxy = getHostProxy();
- } catch (VMWorkerException e) {
- EMLogger.getLogger().info("Failed to get host proxy :" + e.getMessage());
- }
- }
- public static String getHostProxyCmd(VMProperty property) {
+ public static String getHostProxyCmd(VMProperty property) throws VMLauncherException {
String proxyMode = property.getPropertyValue()
.getAdvancedOptionSubValue(ItemName.NET_PROXY,
NetProxyViewItem.ITEM_PROXY_MODE);
if (proxyMode.equals(NetProxyViewItem.MODE_AUTO)) {
+ if (hostProxy == null) {
+ hostProxy = getHostProxy();
+ }
return hostProxy;
}
}
- public static String getHostProxy() throws VMWorkerException {
+ public static String getHostProxy() throws VMLauncherException {
String result = null;
String proxyCommand = "check-net";
if (EmulatorManager.isWin()) {
.openWarningAndSelectionDialog("Failed to get host proxy setting."
+ "\n"
+ res.getResultMessage()
- + "\nContinue creating anyway ?");
+ + "\nContinue launching anyway ?");
if (dialogRes != SWT.OK) {
- throw new VMWorkerException("User canceled creating VM.");
+ throw new VMLauncherException("User canceled launching VM.");
}
}