From fd362e8bfce30697c475b5433473eaee2c808213 Mon Sep 17 00:00:00 2001 From: jihye kim Date: Tue, 27 Mar 2012 00:20:05 +0900 Subject: [PATCH] [Title] modfiy copy SD Card image and modfiy emulator-manager.sh [Type] Enhancement [Module] emulator-manager [Priority] major [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- dist/linux/emulator-manager.sh | 5 ++++ package/pkginfo.manifest | 4 +-- src/org/tizen/emulator/manager/vms/Modifier.java | 35 ++++++++++++++-------- .../emulator/manager/vms/VMPropertyValue.java | 12 ++++++-- 4 files changed, 39 insertions(+), 17 deletions(-) diff --git a/dist/linux/emulator-manager.sh b/dist/linux/emulator-manager.sh index 40e6958..8444f4c 100755 --- a/dist/linux/emulator-manager.sh +++ b/dist/linux/emulator-manager.sh @@ -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" diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index c3596e6..e33038f 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -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 @@ -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 diff --git a/src/org/tizen/emulator/manager/vms/Modifier.java b/src/org/tizen/emulator/manager/vms/Modifier.java index e26df84..225ee8b 100644 --- a/src/org/tizen/emulator/manager/vms/Modifier.java +++ b/src/org/tizen/emulator/manager/vms/Modifier.java @@ -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()); } diff --git a/src/org/tizen/emulator/manager/vms/VMPropertyValue.java b/src/org/tizen/emulator/manager/vms/VMPropertyValue.java index b6b52bf..a228d17 100644 --- a/src/org/tizen/emulator/manager/vms/VMPropertyValue.java +++ b/src/org/tizen/emulator/manager/vms/VMPropertyValue.java @@ -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; -- 2.7.4