[Title] modfiy copy SD Card image and modfiy emulator-manager.sh
authorjihye kim <jihye1128.kim@samsung.com>
Mon, 26 Mar 2012 15:20:05 +0000 (00:20 +0900)
committerjihye kim <jihye1128.kim@samsung.com>
Mon, 26 Mar 2012 15:20:05 +0000 (00:20 +0900)
[Type] Enhancement
[Module] emulator-manager
[Priority] major
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

dist/linux/emulator-manager.sh
package/pkginfo.manifest
src/org/tizen/emulator/manager/vms/Modifier.java
src/org/tizen/emulator/manager/vms/VMPropertyValue.java

index 40e6958..8444f4c 100755 (executable)
@@ -4,7 +4,12 @@ tizen_path=`grep TIZEN_SDK_INSTALLED_PATH ${HOME}/.TizenSDK/tizensdkpath`
 TIZEN_SDK_INSTALL_PATH=`echo $tizen_path | cut -f2- -d"="`
 #echo $TIZEN_SDK_INSTALL_PATH
 
+if [ ! -f $TIZEN_SDK_INSTALL_PATH ]
+then
 em_path=`echo $TIZEN_SDK_INSTALL_PATH"/Emulator/bin"`
+else
+em_path="."
+fi
 #echo $em_path
 
 java -jar $em_path"/emulator-manager.jar"
index c3596e6..e33038f 100644 (file)
@@ -1,5 +1,5 @@
 Package: emulator-manager
-Version: 1.0.15
+Version: 1.0.16
 OS: linux
 Build-host-os: linux
 Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
@@ -7,7 +7,7 @@ Source: emulator-manager
 Description: Tizen Emulator Manager
 
 Package: emulator-manager
-Version: 1.0.15
+Version: 1.0.16
 OS: windows
 Build-host-os: windows
 Maintainer: Yeong-Kyoon Lee<yeongkyoon.lee@samsung.com>
index e26df84..225ee8b 100644 (file)
@@ -1,10 +1,11 @@
 package org.tizen.emulator.manager.vms;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.nio.channels.FileChannel;
 
 import org.tizen.emulator.manager.tool.FileIO;
 
@@ -15,7 +16,6 @@ public class Modifier {
                if(oldVM.equals(newVM)) {// if nothing if modified...
                        return;
                }
-
                
                if (!newVM.resolution.equals(oldVM.resolution)) {
                        int i = newVM.resolution.indexOf('x');
@@ -96,24 +96,33 @@ public class Modifier {
                                throw new VMsWorkerException("Create new image path is failed !");
                        }
 
-                       FileReader in  = null;
-                       FileWriter out = null;
+                       
+                       FileInputStream inputStream = null;
+                       FileOutputStream outputStream = null;
+                       FileChannel fcin = null;
+                       FileChannel fcout = null;
                        try {
-                               in  = new FileReader(src);
-                               out = new FileWriter(dest);
+                               inputStream = new FileInputStream(src);         
+                               outputStream = new FileOutputStream(dest);
 
-                               int c;
-                               while((c = in.read()) != -1) {
-                                       out.write(c);
-                               }
+                               fcin =  inputStream.getChannel();
+                               fcout = outputStream.getChannel();
+                               long size = fcin.size();
+                               fcin.transferTo(0, size, fcout);
                        } catch (FileNotFoundException e) {
                                throw new VMsWorkerException("SD Card image create failed!\n" + e.getMessage());
                        } catch (IOException e) {
                                throw new VMsWorkerException("SD Card image create failed!\n" + e.getMessage());
                        }finally {
                                try {
-                                       if (in != null) in.close();
-                                       if (out != null) out.close();
+                                       if (fcout != null)
+                                               fcout.close();
+                                       if (fcin != null)
+                                               fcin.close();
+                                       if (outputStream != null)
+                                               outputStream.close();
+                                       if (inputStream != null)
+                                               inputStream.close();
                                } catch (IOException e) {
                                        throw new VMsWorkerException(e.getMessage());
                                }
index b6b52bf..a228d17 100644 (file)
@@ -138,12 +138,20 @@ public class VMPropertyValue implements Cloneable {
                        return false;
                if(this.keyType != dest.keyType)
                        return false;
-               if(this.isSDCardSupport != dest.isSDCardSupport)
+               if(this.isSDCardSupport != dest.isSDCardSupport) {
                        return false;
+               } else {
+                       if (!this.SDCardPath.equals(dest.SDCardPath))
+                               return false;
+               }
                if(this.ramSize != dest.ramSize)
                        return false;
-               if(this.isFileShareSupport != dest.isFileShareSupport)
+               if(this.isFileShareSupport != dest.isFileShareSupport) {
                        return false;
+               } else {
+                       if (!this.fileSharePath.equals(dest.fileSharePath))
+                               return false;
+               }
                if (this.isHWVirtualization != dest.isHWVirtualization)
                        return false;