protected String id = "0";
protected String name;
protected String version;
- protected String releaseVersion;
protected String domain;
protected String cpu;
throw new IOException("Image name is null. This image can not add.");
}
version = prop.getProperty(StringResources.IMAGE_VERSION, platform.getName());
- releaseVersion = prop.getProperty(StringResources.RELEASE_VERSION, "Not identified");
domain = prop.getProperty(StringResources.PRODUCT_DOMAIN, "Phone");
cpu = prop.getProperty(StringResources.TARGET_CPU, "x86");
cpu = cpu.toLowerCase();
+ " Platform : " + getPlatformName() + StringResources.NEW_LINE
+ " Type : " + getType() + StringResources.NEW_LINE
+ " Version : " + getVersion() + StringResources.NEW_LINE
- + " Release Version : " + getRelease() + StringResources.NEW_LINE
+ " Target CPU : " + getCpu() + StringResources.NEW_LINE
+ " Product Domain : " + getDomain() + StringResources.NEW_LINE
+ " Base Disk Image Path : " + getPath() + StringResources.NEW_LINE;
return domain;
}
- public String getRelease() {
- return releaseVersion;
- }
-
public String getName() {
return name;
}
private final static String swap_suffix = File.separator + "swap";
private final static String data_suffix = File.separator +"data";
-// final static String sdkpath_suffix = File.separator + "tizensdkpath";
+ final static String sdkpath_suffix = File.separator + "tizensdkpath";
final static String sdkdata_suffix = File.separator + "tizen-sdk-data";
final static String win_sdb_exec = File.separator + "sdb.exe";
final static String sdb_exec = File.separator + "sdb";
}
// tizen_sdk path
- String tizenSDKDataPath = "";
- {
- // read sdk.info file
- File sdkInfoFile = new File(currentPath + File.separator + sdk_suffix+ sdkinfo_suffix);
- if (sdkInfoFile.exists()) {
- BufferedReader in = null;
- try {
- in = new BufferedReader(new FileReader(sdkInfoFile));
- } catch (FileNotFoundException e) {
- EMLogger.getLogger().warning(e.getMessage());
- }
- String s = null;;
- try {
- while((s = in.readLine()) != null) {
- int i = s.indexOf("=");
- if (i != -1) {
- String s1 = s.substring(0, i);
- String s2 = s.substring(i+1, s.length());
- if (s1.equals("TIZEN_SDK_INSTALLED_PATH")) {
- sdkPath = s2;
- } else if (s1.equals("TIZEN_SDK_DATA_PATH")) {
- tizenSDKDataPath = s2;
- }
- }
- }
- } catch (IOException e) {
- EMLogger.getLogger().warning(e.getMessage());
- }
-
- try {
- in.close();
- } catch (IOException e) {
- EMLogger.getLogger().warning(e.getMessage());
- }
- } else {
- // read .lock file
- File lockFile = new File(currentPath + File.separator
- + "." + System.getProperty("user.name") + ".lock");
- if (lockFile.exists()) {
- BufferedReader in = null;
- try {
- in = new BufferedReader(new FileReader(lockFile));
- } catch (FileNotFoundException e) {
- EMLogger.getLogger().warning(e.getMessage());
- }
- if (in != null) {
- try {
- tizenSDKDataPath = in.readLine();
- } catch (IOException e) {
- EMLogger.getLogger().warning(e.getMessage());
- } finally {
- try {
- in.close();
- } catch (IOException e) {
- EMLogger.getLogger().warning(e.getMessage());
- }
- }
- }
- }
- }
-
- if (tizenSDKDataPath == null || tizenSDKDataPath.equals("")) {
- String home = System.getProperty("user.home");
- tizenSDKDataPath = home + sdkdata_suffix;
- }
+ String tizenSDKDataPath = findSDKDataPath();
+ if (tizenSDKDataPath == null || tizenSDKDataPath.equals("")) {
+ String home = System.getProperty("user.home");
+ tizenSDKDataPath = home + sdkdata_suffix;
}
if (sdkPath != null) {
dataSkinPath = workspacePath + skin_suffix;
}
+ private static String findSDKDataPath() {
+ String dataPath = null;
+ // read sdk.info file
+ File sdkInfoFile = new File(currentPath + File.separator + sdk_suffix+ sdkinfo_suffix);
+ if (sdkInfoFile.exists()) {
+ BufferedReader in = null;
+ try {
+ in = new BufferedReader(new FileReader(sdkInfoFile));
+ } catch (FileNotFoundException e) {
+ EMLogger.getLogger().warning(e.getMessage());
+ }
+ String s = null;;
+ try {
+ while((s = in.readLine()) != null) {
+ int i = s.indexOf("=");
+ if (i != -1) {
+ String s1 = s.substring(0, i);
+ String s2 = s.substring(i+1, s.length());
+ if (s1.equals("TIZEN_SDK_INSTALLED_PATH")) {
+ sdkPath = s2;
+ } else if (s1.equals("TIZEN_SDK_DATA_PATH")) {
+ dataPath = s2;
+ }
+ }
+ }
+ } catch (IOException e) {
+ EMLogger.getLogger().warning(e.getMessage());
+ }
+
+ try {
+ in.close();
+ } catch (IOException e) {
+ EMLogger.getLogger().warning(e.getMessage());
+ }
+ }
+
+ if (dataPath == null || dataPath.isEmpty()) {
+ // read .lock file
+ File lockFile = new File(currentPath + File.separator
+ + "." + System.getProperty("user.name") + ".lock");
+ if (lockFile.exists()) {
+ BufferedReader in = null;
+ try {
+ in = new BufferedReader(new FileReader(lockFile));
+ } catch (FileNotFoundException e) {
+ EMLogger.getLogger().warning(e.getMessage());
+ }
+ if (in != null) {
+ try {
+ dataPath = in.readLine();
+ } catch (IOException e) {
+ EMLogger.getLogger().warning(e.getMessage());
+ } finally {
+ try {
+ in.close();
+ } catch (IOException e) {
+ EMLogger.getLogger().warning(e.getMessage());
+ }
+ }
+ }
+ }
+
+ File f = null;
+ if (dataPath != null && !dataPath.equals("")) {
+ f = new File(dataPath + sdkpath_suffix);
+ } else {
+ String home = System.getProperty("user.home");
+ f = new File(home + sdkdata_suffix + sdkpath_suffix);
+ }
+
+ if (f.exists()) {
+ try {
+ BufferedReader in = new BufferedReader(new FileReader(f));
+ String s;
+ while((s = in.readLine()) != null) {
+ int i = s.indexOf("=");
+ if (i != -1) {
+ String s2 = s.substring(i+1, s.length());
+ sdkPath = s2;
+ }
+ }
+ in.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ return dataPath;
+ }
+
public static void testPrintPath() {
System.out.println(currentPath);
System.out.println(emulatorPath);
System.out.println(biosPath);
System.out.println(workspacePath);
System.out.println(vmsPath);
-
}
static FilePathResouces instance = null;