[Title] if ".sdk_delta.info" file cannot download, does not make oldTree.
authorGun Kim <gune.kim@samsung.com>
Thu, 18 Apr 2013 04:29:08 +0000 (13:29 +0900)
committerGun Kim <gune.kim@samsung.com>
Thu, 18 Apr 2013 04:29:08 +0000 (13:29 +0900)
[Type]
[Module]
[Priority]
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

Change-Id: I06573ae227b3a11e04be2046532c086e48d37857

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

index caa3dd8..272afc1 100755 (executable)
@@ -51,6 +51,7 @@ import org.tizen.common.util.IOUtil;
 import org.tizen.common.util.log.Logger;
 import org.tizen.sdblib.IDevice;
 import org.tizen.sdblib.SyncService;
+import org.tizen.sdblib.SyncService.SyncResult;
 
 /**
  * Delta Detector for Rapid Development Support.
@@ -79,12 +80,13 @@ public class RdsDeltaDetector {
      * Reads the <code>STR_TREE_FILE</code>, and sets the <code>oldTree</code>.
      */
     public void readOldTree() {
-        downloadOldTree();
+        String strLocalFile = downloadOldTree();
+        if ( strLocalFile == null ) {
+            return;
+        }
         Workspace workspace = ((Workspace)project.getWorkspace());
         ElementTreeReader treeReader = new ElementTreeReader(workspace.getSaveManager());
         
-        String strLocalFile = project.getLocation().toString() + "/" + STR_TREE_FILE;
-        
         DataInputStream input = null;
         try {
             input = new DataInputStream(new SafeFileInputStream(strLocalFile, strLocalFile + ".temp", TREE_BUFFER_SIZE));
@@ -125,7 +127,10 @@ public class RdsDeltaDetector {
         String deltaFileOnRemote = remotePath + STR_TREE_DIRECTORY + STR_TREE_FILE;
         strLocalFile = project.getLocation().toString() + "/" + STR_TREE_FILE;
         try {
-            device.getSyncService().pullFile(deltaFileOnRemote, strLocalFile, true, SyncService.getNullProgressMonitor());
+            SyncResult result = device.getSyncService().pullFile(deltaFileOnRemote, strLocalFile, true, SyncService.getNullProgressMonitor());
+            if ( result.getCode() != SyncService.RESULT_OK ) {
+                throw new Exception(result.getMessage());
+            }
         } catch (Exception e) {
             return null;
         }