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";
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);
+ }
+ }
}