[Title] fixed bug : use "mkdir" command, if delta is directory.
authorGun Kim <gune.kim@samsung.com>
Wed, 21 Nov 2012 05:54:21 +0000 (14:54 +0900)
committerGun Kim <gune.kim@samsung.com>
Wed, 21 Nov 2012 05:54:21 +0000 (14:54 +0900)
[Type]
[Module]
[Priority]
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

Change-Id: I68bf666a65e44c878b824989a1eaa7e161ba704c

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

index 6fa4f81..28a8a31 100644 (file)
@@ -26,6 +26,7 @@
 
 package org.tizen.common.rds;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
@@ -123,12 +124,18 @@ public abstract class RdsDeployer {
             if ( DeltaResourceInfo.TYPE_MODIFY.equals(node.getType()) ) {
                 try {
                     command = RdsDeployer.makeRdsLog(NLS.bind(RdsMessages.RDS_PUSH_LOG, node.getFullPath(), strRemotePath));
-                    SyncResult result = device.getSyncService().pushFile(node.getFullPath(), strRemotePath, SyncService.getNullProgressMonitor());
-                    if ( result.getCode() == SyncService.RESULT_NO_LOCAL_FILE || result.getCode() == SyncService.RESULT_LOCAL_IS_DIRECTORY) {
-                        throw new IOException(command);
+                    if ( new File(node.getFullPath()).isDirectory() ) {
+                        tizenCommand.runCommand( "mkdir -p -m 755 " + strRemotePath + TizenPlatformConstants.CMD_SUFFIX , true, null);
                     }
+                    else {
+                        SyncResult result = device.getSyncService().pushFile(node.getFullPath(), strRemotePath, SyncService.getNullProgressMonitor());
+                        if ( result.getCode() == SyncService.RESULT_NO_LOCAL_FILE || result.getCode() == SyncService.RESULT_LOCAL_IS_DIRECTORY) {
+                            throw new IOException(command);
+                        }
+                    }
+                    
                     printInfo( command );
-                } catch (IOException e) {
+                } catch (Exception e) {
                     newCoreException(RdsDeployer.makeRdsLog(RdsMessages.RDS_PUSH_ERROR), e);
                 }
             }