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.
* 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));
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;
}