[Title] modified RdsDeployer#getDelta() by signning's request.
authorGun Kim <gune.kim@samsung.com>
Mon, 25 Feb 2013 01:57:10 +0000 (10:57 +0900)
committerGun Kim <gune.kim@samsung.com>
Mon, 25 Feb 2013 01:57:10 +0000 (10:57 +0900)
[Type]
[Module]
[Priority]
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

Change-Id: Ie358dc4f68a32cf220b9059f5a5c69f38c8819fb

org.tizen.common/src/org/tizen/common/rds/RdsDeployer.java

index 3a4974f..f91e3df 100644 (file)
@@ -43,6 +43,7 @@ import org.tizen.common.CommonPlugin;
 import org.tizen.common.TizenPlatformConstants;
 import org.tizen.common.ui.view.console.ConsoleManager;
 import org.tizen.common.util.ISdbCommandHelper;
+import org.tizen.common.util.StringUtil;
 import org.tizen.common.util.log.Logger;
 import org.tizen.sdblib.IDevice;
 import org.tizen.sdblib.SyncService;
@@ -65,6 +66,10 @@ public abstract class RdsDeployer implements Closeable{
     protected List<DeltaResourceInfo> interestList = new ArrayList<DeltaResourceInfo>();
     private SyncService syncService;
     private final static String[] needAppOwnerArray = new String[] {"/data", "/shared/data", "/shared/trusted", "/setting"};
+    // deltaInfoList should be set only once.
+    private List<DeltaResourceInfo> deltaInfoList = null;
+    // strDeltaInfoFile should be set when deltaInfoList is set.
+    private String strDeltaInfoFile = "";
 
     /**
      * Prints progress information.
@@ -180,8 +185,17 @@ public abstract class RdsDeployer implements Closeable{
         }
     }
 
-    protected List<DeltaResourceInfo> getDelta() {
-        return deltaDetector.getDelta(null, null);
+    public List<DeltaResourceInfo> getDelta() {
+        if ( deltaInfoList == null)  {
+            deltaInfoList = deltaDetector.getDelta(null, null);
+            strDeltaInfoFile = deltaDetector.makeDeltaFile(null,null);
+        }
+        return deltaInfoList;
+    }
+    
+    public String getDeltaInfoFile() {
+        getDelta();
+        return strDeltaInfoFile;
     }
     
     protected void postInstall() throws CoreException {
@@ -204,12 +218,13 @@ public abstract class RdsDeployer implements Closeable{
     
     public void pushResInfoFile() {
         String appInstallPath = getAppInstallPath();
+        
+        getDelta();
 
-        String strResInfoFile = deltaDetector.makeDeltaFile(null,null);
         String strRemotePath = appInstallPath + RdsDeltaDetector.STR_TREE_DIRECTORY + RdsDeltaDetector.STR_TREE_FILE;
         
         try {
-            getSyncService().pushFile(strResInfoFile, strRemotePath, SyncService.getNullProgressMonitor());
+            getSyncService().pushFile(strDeltaInfoFile, strRemotePath, SyncService.getNullProgressMonitor());
         } catch (Exception e) {
             Logger.error(RdsDeployer.makeRdsLog(RdsMessages.RDS_RES_INFO_PUSH_ERROR), e);
         }