From 03b747a4de421220a4e9023de6334e44c39d9cc3 Mon Sep 17 00:00:00 2001 From: Gun Kim Date: Thu, 18 Apr 2013 13:29:08 +0900 Subject: [PATCH] [Title] if ".sdk_delta.info" file cannot download, does not make oldTree. [Type] [Module] [Priority] [Jira#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] Change-Id: I06573ae227b3a11e04be2046532c086e48d37857 --- .../src/org/tizen/common/rds/RdsDeltaDetector.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/org.tizen.common/src/org/tizen/common/rds/RdsDeltaDetector.java b/org.tizen.common/src/org/tizen/common/rds/RdsDeltaDetector.java index caa3dd8..272afc1 100755 --- a/org.tizen.common/src/org/tizen/common/rds/RdsDeltaDetector.java +++ b/org.tizen.common/src/org/tizen/common/rds/RdsDeltaDetector.java @@ -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 STR_TREE_FILE, and sets the oldTree. */ 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; } -- 2.7.4