From: YoonKi Park Date: Thu, 8 Dec 2011 08:18:01 +0000 (+0900) Subject: [Title] fixed load sdk path in case of windows X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd260bed4d727501e6491b82af25b1f49fadd9a1;p=sdk%2Fide%2Fcommon-eplugin.git [Title] fixed load sdk path in case of windows --- diff --git a/com.samsung.tizen.common/src/com/samsung/tizen/common/properties/InstallPathConfig.java b/com.samsung.tizen.common/src/com/samsung/tizen/common/properties/InstallPathConfig.java index 1567502..d17110c 100644 --- a/com.samsung.tizen.common/src/com/samsung/tizen/common/properties/InstallPathConfig.java +++ b/com.samsung.tizen.common/src/com/samsung/tizen/common/properties/InstallPathConfig.java @@ -28,7 +28,7 @@ import com.samsung.tizen.common.util.OSChecker; final public class InstallPathConfig { private static String sdkInstallPath; - private final static String SDKSUFFIX = "/.TizenSDK/tizensdkpath"; + private final static String SDKSUFFIX = File.separatorChar+".TizenSDK"+File.separatorChar+"tizensdkpath"; private final static String EMULATOR_PATH = "Emulator"; private final static String INSTALLER_PATH = "InstallManager"; @@ -37,46 +37,48 @@ final public class InstallPathConfig { String sdkPath; if (OSChecker.isWindows()) { - sdkPath = System.getenv("localappdata") + File.separatorChar + SDKSUFFIX; - - if (HostUtil.exists(sdkPath)) - sdkInstallPath = sdkPath; - else { - DialogUtil.openMessageDialog("Tizen SDK is not installed propertly."); - System.exit(0); - } + sdkPath = System.getenv("localappdata") + File.separatorChar + SDKSUFFIX; + loadSdkPath(sdkPath); } else if (OSChecker.isLinux() == true || OSChecker.isUnix() == true || OSChecker.isMAC() == true) { sdkPath= System.getProperty("user.home") + File.separatorChar + SDKSUFFIX; - if (HostUtil.exists(sdkPath)) { - String[] fileContent = HostUtil.getContents(sdkPath).split("="); - if (HostUtil.exists(fileContent[1])) - sdkInstallPath = fileContent[1]; - else { - DialogUtil.openMessageDialog("Tizen SDK is not installed propertly."); - System.exit(0); - } - } else { - DialogUtil.openMessageDialog("Tizen SDK is not installed propertly."); - System.exit(0); - } + loadSdkPath(sdkPath); } else { DialogUtil.openMessageDialog(System.getProperty("os.name") + " is not supported currently."); System.exit(0); } } + public static String getEmulatorPath(){ return sdkInstallPath + File.separatorChar + EMULATOR_PATH; } + public static String getIDEPath() { // FIXME : can't help but putting the code due to the wac ide path , It has to be removed soon. return System.getProperty("user.dir"); } + public static String getSDKPath() { return sdkInstallPath; } + public static String getInstallManagerPath() { return sdkInstallPath + File.separatorChar + INSTALLER_PATH; } + + private static void loadSdkPath(String sdkPath) { + if (HostUtil.exists(sdkPath)) { + String[] fileContent = HostUtil.getContents(sdkPath).split("="); + if (HostUtil.exists(fileContent[1])) + sdkInstallPath = fileContent[1]; + else { + DialogUtil.openMessageDialog("Tizen SDK is not installed propertly."); + System.exit(0); + } + } else { + DialogUtil.openMessageDialog("Tizen SDK is not installed propertly."); + System.exit(0); + } + } }