From bf7b93fa87f087f6cc9e60c881d87089348e1aa5 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Thu, 1 Jun 2006 14:56:52 +0000 Subject: [PATCH] no need for Display dependency now that always using worker job for downloads and uploads --- .../dstore/files/DStoreFileService.java | 50 +++---------------- 1 file changed, 7 insertions(+), 43 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreFileService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreFileService.java index 1f996f52a06..289736544f7 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreFileService.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/files/DStoreFileService.java @@ -52,7 +52,7 @@ import org.eclipse.rse.services.dstore.util.DownloadListener; import org.eclipse.rse.services.dstore.util.FileSystemMessageUtil; import org.eclipse.rse.services.files.IFileService; import org.eclipse.rse.services.files.IHostFile; -import org.eclipse.swt.widgets.Display; + @@ -183,7 +183,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer boolean isCancelled = false; - Display display = Display.getCurrent(); + try @@ -210,10 +210,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer // upload bytes while available while (available > 0 && !isCancelled) { - if (display != null && !display.isDisposed()) - { - while (display.readAndDispatch()) {} - } + numToRead = (available < buffer_size) ? available : buffer_size; @@ -263,16 +260,11 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer } - if (display != null && monitor != null) + if (monitor != null) { isCancelled = monitor.isCanceled(); - if (isCancelled) - { - while (display.readAndDispatch()) - { - } - } + } available = bufInputStream.available(); @@ -335,12 +327,6 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer } - if (display != null && monitor != null) - { - // monitor.done(); - while (display.readAndDispatch()) { - } - } return true; } @@ -353,8 +339,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer boolean isCancelled = false; boolean transferSuccessful = false; - Display display = Display.getCurrent(); - + long totalBytes = file.length(); try @@ -395,10 +380,6 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer // upload bytes while available while (available > 0 && !isCancelled) { - if (display != null && !display.isDisposed()) - { - while (display.readAndDispatch()) {} - } numToRead = (available < buffer_size) ? available : buffer_size; @@ -469,22 +450,11 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer String str = MessageFormat.format(_percentMsg, new Object[] {totalSentBuf, totalBuf, percentBuf}); monitor.subTask(str); - if (display != null) - { - while (display.readAndDispatch()) - { - } - } + isCancelled = monitor.isCanceled(); - if (isCancelled && display != null) - { - while (display.readAndDispatch()) - { - } - } } available = bufInputStream.available(); @@ -572,12 +542,6 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer } } - if (display != null && monitor != null) - { - // monitor.done(); - while (display.readAndDispatch()) { - } - } return true; }