Platform: add making emulator directory routine
authorjihye424.kim <jihye424.kim@samsung.com>
Wed, 17 Jun 2015 08:52:28 +0000 (17:52 +0900)
committerSangho Park <sangho.p@samsung.com>
Thu, 18 Jun 2015 02:38:29 +0000 (11:38 +0900)
Change-Id: I2172822727f364474b342b697f48b8345319f3dd
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/platform/Platform.java

index bb275bf..fc88af1 100644 (file)
@@ -119,20 +119,30 @@ public class Platform {
        private void initializePlatform(Profile profile, EMPlugin plugin) {
                this.profileClass = profile;
                this.profile = profile.getName();
+               this.plugin = plugin;
                this.version = plugin.getAttribute(PluginStringResources.PlatformVersion);
                this.platformName = plugin.getPlatformName();
                this.platformPath = plugin.getPlatformPath();
-               this.emulatorPath = plugin.getAttribute(PluginStringResources.EmulatorDir);
-               if (this.emulatorPath == null) {
-                       this.emulatorPath = FilePathResources.getPlatformEmulatorPath(version);
-               }
-               this.plugin = plugin;
+               this.emulatorPath = makingEmulatorDir();
 
                loadSkins();
                loadPlugin();
                loadTemplate();
        }
 
+       private String makingEmulatorDir() {
+               String path = plugin.getAttribute(PluginStringResources.EmulatorDir);
+               if (path != null) {
+                       File file = new File(path);
+                       if (!file.isAbsolute()) {
+                               path = FilePathResources.getSdkRoot() + File.separator + path;
+                       }
+               } else {
+                       path = FilePathResources.getPlatformEmulatorPath(version);
+               }
+               return path;
+       }
+
        public String getName() {
                return platformName;
        }