diff options
| author | unknown | 2014-05-17 17:48:02 +0200 |
|---|---|---|
| committer | unknown | 2014-05-17 17:48:02 +0200 |
| commit | dd96e8d4543ad8887af1cb2d8877f9f8fb830fa1 (patch) | |
| tree | f5aa67beb61638103f0667384bee18c82f5a50c4 /Dozentenmodul/src/ftp/UploadTask.java | |
| parent | asdfdsgdfgdfh (diff) | |
| parent | nix (diff) | |
| download | tutor-module-dd96e8d4543ad8887af1cb2d8877f9f8fb830fa1.tar.gz tutor-module-dd96e8d4543ad8887af1cb2d8877f9f8fb830fa1.tar.xz tutor-module-dd96e8d4543ad8887af1cb2d8877f9f8fb830fa1.zip | |
Merge branch 'master' of ssh://git.openslx.org/openslx-ng/tutor-module
Conflicts:
fdghf
Dozentenmodul/bin/gui/image/DeleteImage_GUI.class
Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI$2.class
Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI$3.class
Dozentenmodul/bin/gui/image/EditImageAllgemein_GUI.class
Dozentenmodul/src/gui/image/DeleteImage_GUI.java
Diffstat (limited to 'Dozentenmodul/src/ftp/UploadTask.java')
| -rw-r--r-- | Dozentenmodul/src/ftp/UploadTask.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Dozentenmodul/src/ftp/UploadTask.java b/Dozentenmodul/src/ftp/UploadTask.java index 2dbeff8d..06d76dc8 100644 --- a/Dozentenmodul/src/ftp/UploadTask.java +++ b/Dozentenmodul/src/ftp/UploadTask.java @@ -49,6 +49,7 @@ public class UploadTask extends SwingWorker<Void, Void> { FileInputStream inputStream = new FileInputStream(uploadFile); byte[] buffer = new byte[BUFFER_SIZE]; int bytesRead = -1; + int i=0; long totalBytesRead = 0; int percentCompleted = 0; long fileSize = uploadFile.length(); @@ -57,7 +58,7 @@ public class UploadTask extends SwingWorker<Void, Void> { final double NANOS_PER_SECOND = 1000000000.0; final double BYTES_PER_MIB = 1024*1024; while ((bytesRead = inputStream.read(buffer)) != -1 && isCancelled()==false) { - util.writeFileBytes(buffer, 0, bytesRead); + util.writeFileBytes(buffer, 0, bytesRead); totalBytesRead += bytesRead; percentCompleted = (int) (totalBytesRead * 100 / fileSize); double speed = NANOS_PER_SECOND / BYTES_PER_MIB * totalBytesRead / (System.nanoTime() - start + 1); |
