summaryrefslogtreecommitdiffstats
path: root/idrop-lite
diff options
context:
space:
mode:
authorLISA STILLWELL <lisa@simon.local>2012-07-06 20:10:05 (GMT)
committer LISA STILLWELL <lisa@simon.local>2012-07-06 20:10:05 (GMT)
commit4e2e1880da66fc0ce92bf183fee976468e8a5111 (patch)
tree28b56f4387cfeeef6b3eb9387c2fcca944ed0bdf /idrop-lite
parent559db2320ec6dc0978c49b526dde18f0fc5d3a3c (diff)
downloadQCG-Data-4e2e1880da66fc0ce92bf183fee976468e8a5111.zip
QCG-Data-4e2e1880da66fc0ce92bf183fee976468e8a5111.tar.gz
QCG-Data-4e2e1880da66fc0ce92bf183fee976468e8a5111.tar.bz2
[#833] added logic to check completion percentage of files in upload table and only process them if upload completion percentage is less than 100.
Diffstat (limited to 'idrop-lite')
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java47
1 files changed, 28 insertions, 19 deletions
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java
index 49830bf..664328e 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java
@@ -2560,29 +2560,38 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
// collect list of files and/or URLS in the table
int rows = tblUploadTable1.getRowCount();
- this.filesInTable = rows; // reset to 0 in overall status callback when all files have been transferred
+ //this.filesInTable = rows; // reset to 0 in overall status callback when all files have been transferred
+ this.filesInTable = 0; // #833 ignore items in table that have already been uploaded
for (int row = 0; row < rows; row++) {
- if ((Integer) tblUploadTable1.getValueAt(row, 4) == iDropLiteApplet.uploadURL) { // this is an URL
- sourceFiles.add(new UploadDataObj((String) tblUploadTable1.getValueAt(row, 0), Boolean.TRUE));
- } else { // this is just a regular file or folder
- sourceFiles.add(new UploadDataObj(new File((String) tblUploadTable1.getValueAt(row, 0))));
- }
+ // first check to see if the file has already been 100% uploaded, and if so ignore
+ TransferProgressInfo progressInfo = (TransferProgressInfo)tblUploadTable1.getValueAt(row, 2);
+ if (progressInfo.getPercentDone() < 100) {
+ this.filesInTable++; // now set count of files to be uploaded
+ if ((Integer) tblUploadTable1.getValueAt(row, 4) == iDropLiteApplet.uploadURL) { // this is an URL
+ sourceFiles.add(new UploadDataObj((String) tblUploadTable1.getValueAt(row, 0), Boolean.TRUE));
+ } else { // this is just a regular file or folder
+ sourceFiles.add(new UploadDataObj(new File((String) tblUploadTable1.getValueAt(row, 0))));
+ }
+ }
}
// set Upload button test to Cancel
- try {
- currentTransferRunner = new PutTransferRunner(applet, targetPath, sourceFiles);
- final Thread transferThread = new Thread(currentTransferRunner);
- log.info("launching transfer thread");
- // close so that transfer thread can grab account
- irodsFileSystem.closeAndEatExceptions();
- transferThread.start();
- //transferThread.join();
- } catch (Exception e) {
- log.error("exception choosings iRODS file");
- throw new IdropRuntimeException("exception choosing irods file", e);
- } finally {
- iDropCore.getIrodsFileSystem().closeAndEatExceptions();
+ // make sure there is stuff to upload
+ if ( sourceFiles.size() > 0) {
+ try {
+ currentTransferRunner = new PutTransferRunner(applet, targetPath, sourceFiles);
+ final Thread transferThread = new Thread(currentTransferRunner);
+ log.info("launching transfer thread");
+ // close so that transfer thread can grab account
+ irodsFileSystem.closeAndEatExceptions();
+ transferThread.start();
+ //transferThread.join();
+ } catch (Exception e) {
+ log.error("exception choosings iRODS file");
+ throw new IdropRuntimeException("exception choosing irods file", e);
+ } finally {
+ iDropCore.getIrodsFileSystem().closeAndEatExceptions();
+ }
}
}