package org.tizen.nativeplatform.launch.wizards;
+import static org.tizen.common.util.IOUtil.tryClose;
import static org.tizen.sdblib.service.SyncServiceConstants.RESULT_OK;
import static org.tizen.sdblib.util.DeviceUtil.isOnline;
import java.io.BufferedReader;
import java.io.File;
+import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public void copyFileToDevice(IDevice device, String srcPath, String descPath)
throws CoreException, TimeoutException, SdbCommandRejectedException, IOException {
- SyncResult syncSuccess = device.getSyncService().push(srcPath, device.getFileEntry( descPath ) );
-
- if (syncSuccess.getCode() != RESULT_OK) {
- LaunchUtils.newCoreException(TizenLaunchMessages.CANNOT_TRANSFER_FILE, null);
- }
+
+ FileInputStream fileIn = null;
+ try
+ {
+ fileIn = new FileInputStream( srcPath );
+ SyncResult syncSuccess = device.getSyncService().doPush(fileIn, device.getFileEntry( descPath ), null, -1 );
+
+ if (syncSuccess.getCode() != RESULT_OK) {
+ LaunchUtils.newCoreException(TizenLaunchMessages.CANNOT_TRANSFER_FILE, null);
+ }
+ }
+ finally
+ {
+ tryClose( fileIn );
+ }
}
public boolean checkGdbServerInBuildSystem(String rootstrapPath) {
} catch (IOException e) {
return new CommandStatus(IStatus.ERROR, "", e.getMessage(), e);
}
- SyncResult syncResult = syncService.push(filePath, device.getFileEntry( pathOnDevice.toOSString() ) );
+ SyncResult syncResult = syncService.push(filePath, device.getFileEntry( TMP_DIR ) );// Fixxed
if (syncResult.getCode() != RESULT_OK) {
return new CommandStatus(IStatus.ERROR, "", syncResult.getMessage(), null);
}