summaryrefslogtreecommitdiffstats
path: root/idrop-lite
diff options
context:
space:
mode:
authorLISA STILLWELL <lisa@dhcp152-54-6-218.wireless.europa.renci.org>2012-02-01 19:44:29 (GMT)
committer LISA STILLWELL <lisa@dhcp152-54-6-218.wireless.europa.renci.org>2012-02-01 19:44:29 (GMT)
commit4ccaedee3ef7f121270e5d13ab3ff6bfecd64885 (patch)
treeca1a665d6590ca83065bb837de99b7849b38acc4 /idrop-lite
parent8ba22e459b4c38e6b203d1b8cccc0ea377ca3cbb (diff)
downloadQCG-Data-4ccaedee3ef7f121270e5d13ab3ff6bfecd64885.zip
QCG-Data-4ccaedee3ef7f121270e5d13ab3ff6bfecd64885.tar.gz
QCG-Data-4ccaedee3ef7f121270e5d13ab3ff6bfecd64885.tar.bz2
[#620] add reset of transfer status flags when transfer FAILURE message is received and fix tests for valid url in Upload from URL dialog
Diffstat (limited to 'idrop-lite')
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadFromURLDialog.java12
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java5
2 files changed, 14 insertions, 3 deletions
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadFromURLDialog.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadFromURLDialog.java
index b2e22e0..16682ed 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadFromURLDialog.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadFromURLDialog.java
@@ -15,6 +15,7 @@ import java.awt.Color;
import java.awt.Frame;
import java.io.File;
import java.io.IOException;
+import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
@@ -254,7 +255,8 @@ public class UploadFromURLDialog extends javax.swing.JDialog implements TableMod
private void btnUploadDFromURL_AddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUploadDFromURL_AddActionPerformed
URL url = null;
String urlName = null;
- URLConnection connection = null;
+ HttpURLConnection connection = null;
+ int httpCode;
int fileSize = 0;
DefaultTableModel tm = (DefaultTableModel) tblUploadURLS.getModel();
int rowcount = tm.getRowCount();
@@ -267,8 +269,12 @@ public class UploadFromURLDialog extends javax.swing.JDialog implements TableMod
if(urlName != null) {
try {
url = new URL(urlName);
- connection = url.openConnection();
+ connection = (HttpURLConnection) url.openConnection();
+ connection.setRequestMethod ("GET");
+ connection.connect () ;
+ httpCode = connection.getResponseCode() ;
fileSize = connection.getContentLength();
+
} catch (MalformedURLException e) {
idropApplet.showMessageFromOperation("Please enter a valid URL");
return;
@@ -280,7 +286,7 @@ public class UploadFromURLDialog extends javax.swing.JDialog implements TableMod
return;
}
- if(fileSize <= 0) {
+ if(httpCode != HttpURLConnection.HTTP_OK) {
idropApplet.showMessageFromOperation("Please enter a valid URL file for download");
return;
}
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 6664141..2c576e3 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
@@ -747,6 +747,11 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
idrop.showIdropException(ts.getTransferException());
}
idrop.getiDropCore().getTransferControlBlock().setCancelled(true);
+ // reset process transfer flags
+ if (isTransferInProgress()) {
+ setTransferCancelled(true);
+ setTransferInProgress(false);
+ }
} else if (ts.isIntraFileStatusReport()) {