private static String sdkInstallPath;
private static final String DIR_PLATFORMS = "platforms";
- private static final String DIR_PLATFORMS_VER = "tizen2.1";
+ private static final String DIR_PLATFORMS_VER;
private static final String DIR_SAMPLES = "samples";
private static final String DIR_SNIPPETS = "snippets";
private static final String DIR_ON_DEMAND = "on-demand";
// public static final String REGISTRY_APP_DATA_OF_SHELL_FOLDER = "AppData";
private static final String REGISTRY_LOCAL_APP_DATA_OF_SHELL_FOLDER = "\"Local AppData\"";
// Value Column
- private static final String REG_SZ = "REG_SZ";
+ private static final String REG_VALUE = "REG_SZ";
static {
+ DIR_PLATFORMS_VER = "tizen2.1";
+
// FIXME : don't need the following lines if using environment variable
if (OSChecker.isWindows()) {
- defaultHomePath = getRegistryValue(REGISTRY_PATH_OF_SHELL_FOLDER,REGISTRY_LOCAL_APP_DATA_OF_SHELL_FOLDER) ;
+ defaultHomePath = getRegistryValue(REGISTRY_PATH_OF_SHELL_FOLDER, REGISTRY_LOCAL_APP_DATA_OF_SHELL_FOLDER) ;
} else if (OSChecker.isLinux() == true || OSChecker.isUnix() == true || OSChecker.isMAC() == true) {
defaultHomePath = System.getProperty("user.home");
} else {
//This is temporary code to get platform version path(only for one).
//TODO: Should change to return string array type for various platform version paths.
- public static String getPlatformVersionPath()
- {
+ public static String getPlatformVersionPath() {
String path = null;
String platformPath = getSDKPath() + File.separator + DIR_PLATFORMS;
File platforms = new File(platformPath);
- if(platforms.isDirectory())
- {
+ if (platforms.isDirectory()) {
// platforms.listFiles[0] can cause undetermined result like platforms/tmp.ini/sample
path = platformPath + File.separator + DIR_PLATFORMS_VER;
}
}
//TODO: Should change to get string array type for various platform version paths.
- public static String getSamplesPath()
- {
+ public static String getSamplesPath() {
return getPlatformVersionPath() + File.separator + DIR_SAMPLES;
}
//TODO: Should change to get string array type for various platform version paths.
- public static String getSnippetsPath()
- {
+ public static String getSnippetsPath() {
return getPlatformVersionPath() + File.separator + DIR_SNIPPETS;
}
//TODO: Should change to get string array type for various platform version paths.
- public static String getOnDemandPath()
- {
+ public static String getOnDemandPath() {
return getPlatformVersionPath() + File.separator + DIR_ON_DEMAND;
}
public static String getSDBPath() {
String toolsPath = getToolsPath();
- if (OSChecker.isWindows())
- {
+ if (OSChecker.isWindows()) {
return toolsPath + File.separator + "sdb.exe";
}
- else
- {
+ else {
return toolsPath + File.separator + "sdb";
}
}
boolean status = true;
if (HostUtil.exists(sdkPath)) {
String[] fileContent = HostUtil.getContents(sdkPath).split("=");
- if (HostUtil.exists(fileContent[1]))
- {
+ if (HostUtil.exists(fileContent[1])) {
sdkInstallPath = fileContent[1];
}
else {
System.exit(0);
}
}
+
private static String getRegistryValue(String node, String key) {
- if (!OSChecker.isWindows())
- {
+ if (!OSChecker.isWindows()) {
return null;
}
String line = null;
while ((line = br.readLine()) != null) {
- int index = line.indexOf(REG_SZ);
+ int index = line.indexOf(REG_VALUE);
if (index >= 0) {
- value = line.substring(index + REG_SZ.length()).trim();
+ value = line.substring(index + REG_VALUE.length()).trim();
}
}
} catch (IOException e) {