summaryrefslogtreecommitdiffstats
path: root/idrop-lite
diff options
context:
space:
mode:
authorMike Conway <michael.c.conway@gmail.com>2012-02-21 14:44:16 (GMT)
committer Mike Conway <michael.c.conway@gmail.com>2012-02-21 14:44:16 (GMT)
commit672edd1f60d0b0c6952641bc0abbd7ab729f7869 (patch)
tree79d2d568bb57c78847748da1443636386e2aea58 /idrop-lite
parent1077a78a9538066da4ddc9a82082071b3584d08d (diff)
parent0cd9225eea66a2937c1a15734891f10b406ef03d (diff)
downloadQCG-Data-672edd1f60d0b0c6952641bc0abbd7ab729f7869.zip
QCG-Data-672edd1f60d0b0c6952641bc0abbd7ab729f7869.tar.gz
QCG-Data-672edd1f60d0b0c6952641bc0abbd7ab729f7869.tar.bz2
Merge branch 'master' of ssh://code.renci.org/gitroot/irodsidrop
Diffstat (limited to 'idrop-lite')
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/GetTransferRunner.java13
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/PutTransferRunner.java24
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderDialog.java19
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form15
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java40
-rw-r--r--idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties1
6 files changed, 30 insertions, 82 deletions
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/GetTransferRunner.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/GetTransferRunner.java
index 1fb073a..8dc54fb 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/GetTransferRunner.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/GetTransferRunner.java
@@ -16,7 +16,6 @@ public class GetTransferRunner implements Runnable {
private final List<File> sourceFiles;
private final String targetIrodsFileAbsolutePath;
private final iDropLiteApplet idropGui;
- //private final TransferControlBlock transferControlBlock;
private TransferControlBlock transferControlBlock;
public GetTransferRunner(final iDropLiteApplet gui,
@@ -37,14 +36,9 @@ public class GetTransferRunner implements Runnable {
throw new JargonException("null idrop gui");
}
-// if (transferControlBlock == null) {
-// throw new JargonException("null transferControlBlock");
-// }
-
this.targetIrodsFileAbsolutePath = targetPath;
this.sourceFiles = files;
this.idropGui = gui;
- //this.transferControlBlock = transferControlBlock;
}
@@ -55,11 +49,10 @@ public class GetTransferRunner implements Runnable {
// need to create new Transfer Control Block for each transfer since it needs to be reset
// on how many files there are to transfer and how many have been transferred so far
- TransferControlBlock tcb = null;
try {
- tcb = DefaultTransferControlBlock.instance();
- idropGui.getiDropCore().setTransferControlBlock(tcb);
- this.transferControlBlock = tcb;
+ this.transferControlBlock = idropGui.getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory().buildDefaultTransferControlBlockBasedOnJargonProperties();
+ transferControlBlock.getTransferOptions().setIntraFileStatusCallbacks(true);
+ idropGui.getiDropCore().setTransferControlBlock(transferControlBlock);
} catch (JargonException ex) {
java.util.logging.Logger.getLogger(LocalFileTree.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/PutTransferRunner.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/PutTransferRunner.java
index f0c9647..5ab508f 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/PutTransferRunner.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/PutTransferRunner.java
@@ -1,17 +1,7 @@
package org.irods.jargon.idrop.lite;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
import java.util.List;
-
import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.packinstr.TransferOptions;
-import org.irods.jargon.core.pub.DataTransferOperations;
-import org.irods.jargon.core.transfer.DefaultTransferControlBlock;
import org.irods.jargon.core.transfer.TransferControlBlock;
import org.slf4j.LoggerFactory;
@@ -75,11 +65,10 @@ public class PutTransferRunner implements Runnable {
// need to create new Transfer Control Block for each transfer since it needs to be reset
// on how many files there are to transfer and how many have been transferred so far
- TransferControlBlock tcb = null;;
try {
- tcb = DefaultTransferControlBlock.instance();
- idropGui.getiDropCore().setTransferControlBlock(tcb);
- this.transferControlBlock = tcb;
+ this.transferControlBlock = idropGui.getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory().buildDefaultTransferControlBlockBasedOnJargonProperties();
+ transferControlBlock.getTransferOptions().setIntraFileStatusCallbacks(true);
+ idropGui.getiDropCore().setTransferControlBlock(transferControlBlock);
} catch (JargonException ex) {
java.util.logging.Logger.getLogger(LocalFileTree.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);
@@ -105,15 +94,14 @@ public class PutTransferRunner implements Runnable {
String localSourceAbsolutePath = uploadData.getFileName();
String sourceResource = idropGui.getIrodsAccount().getDefaultStorageResource();
-// need to create new Transfer Control Block for each transfer since it needs to be reset
-// on how many files there are to transfer and how many have been transferred so far
-
+ // need to create new Transfer Control Block for each transfer since it needs to be reset
+ // on how many files there are to transfer and how many have been transferred so far
log.info("initiating put transfer");
try {
this.transferControlBlock = idropGui.getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory().buildDefaultTransferControlBlockBasedOnJargonProperties();
transferControlBlock.getTransferOptions().setIntraFileStatusCallbacks(true);
idropGui.getiDropCore().setTransferControlBlock(transferControlBlock);
- idropGui.getiDropCore().getTransferManager().putOperationURL(localSourceAbsolutePath,
+ idropGui.getiDropCore().getTransferManager().putOperationURL(localSourceAbsolutePath,
targetIrodsFileAbsolutePath, sourceResource, idropGui, transferControlBlock);
} catch (JargonException ex) {
java.util.logging.Logger.getLogger(LocalFileTree.class.getName()).log(
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderDialog.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderDialog.java
index 2775209..12c47eb 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderDialog.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderDialog.java
@@ -65,18 +65,19 @@ public class IRODSFinderDialog extends javax.swing.JDialog {
CollectionAndDataObjectListingEntry root = new CollectionAndDataObjectListingEntry();
// Change to start at root for finder dialog - requested in GForge tracker # 484
+// changing this back again to how it was before - GForge tracker #484 was apparently wrong
// if (idropCore.getIdropConfig().isLoginPreset()) {
-// log.info("using policy preset home directory");
-// StringBuilder sb = new StringBuilder();
-// sb.append("/");
-// sb.append(idropCore.getIrodsAccount().getZone());
-// sb.append("/");
-// sb.append("home");
-// root.setParentPath(sb.toString());
-// root.setPathOrName(idropCore.getIrodsAccount().getHomeDirectory());
+ log.info("using policy preset home directory");
+ StringBuilder sb = new StringBuilder();
+ sb.append("/");
+ sb.append(idropCore.getIrodsAccount().getZone());
+ sb.append("/");
+ sb.append("home");
+ root.setParentPath(sb.toString());
+ root.setPathOrName(idropCore.getIrodsAccount().getHomeDirectory());
// } else {
// log.info("using root path, no login preset");
- root.setPathOrName("/");
+// root.setPathOrName("/");
// }
log.info("building new iRODS tree");
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form
index f24a687..339de36 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form
@@ -1680,7 +1680,7 @@
<Container class="javax.swing.JPanel" name="jPanel4">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[300, 40]"/>
+ <Dimension value="[160, 40]"/>
</Property>
</Properties>
<Constraints>
@@ -1704,19 +1704,6 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bntBeginDownloadActionPerformed"/>
</Events>
</Component>
- <Component class="javax.swing.JButton" name="btnCancelDownload">
- <Properties>
- <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
- <Font name="Lucida Grande" size="12" style="0"/>
- </Property>
- <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.btnCancelDownload.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
- </Property>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelDownloadActionPerformed"/>
- </Events>
- </Component>
</SubComponents>
</Container>
</SubComponents>
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 9904a43..76136ee 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
@@ -35,7 +35,6 @@ import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
-import javax.swing.filechooser.FileSystemView;
import javax.swing.table.DefaultTableModel;
import javax.swing.tree.TreePath;
@@ -56,6 +55,7 @@ import org.irods.jargon.datautils.datacache.DataCacheServiceFactory;
import org.irods.jargon.datautils.datacache.DataCacheServiceFactoryImpl;
import org.irods.jargon.datautils.datacache.DataCacheServiceImpl;
import org.irods.jargon.datautils.shoppingcart.FileShoppingCart;
+import org.irods.jargon.datautils.shoppingcart.ShoppingCartEntry;
import org.irods.jargon.datautils.shoppingcart.ShoppingCartService;
import org.irods.jargon.datautils.shoppingcart.ShoppingCartServiceImpl;
import org.irods.jargon.idrop.lite.finder.IRODSFinderDialog;
@@ -1269,6 +1269,12 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
dataCacheServiceFactory);
log.info("getting cart as logged in user, key: {}", this.key);
cart = shoppingCartService.retreiveShoppingCartAsLoggedInUser(this.key);
+
+ // for testing
+ //cart = FileShoppingCart.instance();
+ //ShoppingCartEntry entry = ShoppingCartEntry.instance("/test1/home/test1/NC_DEMv2_6_Tile16.txt");
+ //cart.addAnItem(entry);
+ //
} catch (JargonException e) {
log.error("could not create shopping cart");
Logger.getLogger(iDropLiteApplet.class.getName()).log(Level.SEVERE, null, e);
@@ -1279,9 +1285,6 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
cartContents = cart.getShoppingCartFileList();
}
- // for testing
- // cartContents.add("/renci/home/rods/lisa/icp.out");
-
log.info("returning contents of shopping cart {}", cartContents);
return cartContents;
}
@@ -1308,7 +1311,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
log.error("cannot retrieve irods file size for display in download table");
fileSize = 0;
}
- rowData[1] = (int) fileSize;
+ rowData[1] = fileSize;
rowData[2] = 0;
rowData[3] = Boolean.TRUE;
rowData[4] = fileType;
@@ -1528,7 +1531,6 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
jPanel3 = new javax.swing.JPanel();
jPanel4 = new javax.swing.JPanel();
bntBeginDownload = new javax.swing.JButton();
- btnCancelDownload = new javax.swing.JButton();
pnlIdropWebMode = new javax.swing.JPanel();
pnlIdropWebModeDownloadTarget = new javax.swing.JPanel();
txtIdropWebModeDownloadTarget = new javax.swing.JTextField();
@@ -2105,7 +2107,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
}
) {
Class[] types = new Class [] {
- java.lang.String.class, java.lang.Integer.class, java.lang.Object.class, java.lang.Boolean.class, java.lang.Integer.class
+ java.lang.String.class, java.lang.Long.class, java.lang.Object.class, java.lang.Boolean.class, java.lang.Integer.class
};
boolean[] canEdit = new boolean [] {
false, false, false, true, false
@@ -2305,7 +2307,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
pnlDownloadButtons.setLayout(new java.awt.BorderLayout());
pnlDownloadButtons.add(jPanel3, java.awt.BorderLayout.WEST);
- jPanel4.setPreferredSize(new java.awt.Dimension(300, 40));
+ jPanel4.setPreferredSize(new java.awt.Dimension(160, 40));
bntBeginDownload.setFont(new java.awt.Font("Lucida Grande", 0, 12));
bntBeginDownload.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.bntBeginDownload.text")); // NOI18N
@@ -2316,15 +2318,6 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
});
jPanel4.add(bntBeginDownload);
- btnCancelDownload.setFont(new java.awt.Font("Lucida Grande", 0, 12));
- btnCancelDownload.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.btnCancelDownload.text")); // NOI18N
- btnCancelDownload.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnCancelDownloadActionPerformed(evt);
- }
- });
- jPanel4.add(btnCancelDownload);
-
pnlDownloadButtons.add(jPanel4, java.awt.BorderLayout.EAST);
pnlOperationMode3.add(pnlDownloadButtons, java.awt.BorderLayout.PAGE_END);
@@ -2607,18 +2600,6 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
}
}//GEN-LAST:event_bntBeginDownloadActionPerformed
- private void btnCancelDownloadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelDownloadActionPerformed
- java.awt.EventQueue.invokeLater(new Runnable() {
-
- @Override
- public void run() {
- if (isTransferInProgress()) {
- setTransferCancelled(true);
- }
- }
- });
- }//GEN-LAST:event_btnCancelDownloadActionPerformed
-
private void btnUploadUrlActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUploadUrlActionPerformed
UploadFromURLDialog dlgUploadFromURL = new UploadFromURLDialog(this, true);
dlgUploadFromURL.setSize(495, 200);
@@ -2637,7 +2618,6 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
private javax.swing.JButton bntBeginDownload;
private javax.swing.JButton btnBrowseDownloadTarget;
private javax.swing.JButton btnBrowseIRODSUploadDest;
- private javax.swing.JButton btnCancelDownload;
private javax.swing.JButton btnIdropWebModeBeginDownload;
private javax.swing.JButton btnIdropWebModeTargetBrowse;
private javax.swing.JButton btnIrodsTreeRefresh;
diff --git a/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties b/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties
index f59ca2e..38a814d 100644
--- a/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties
+++ b/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties
@@ -31,7 +31,6 @@ iDropLiteApplet.btnUploadBeginImport.text=Begin Import
iDropLiteApplet.btnUploadUrl.text=Import file from URL
iDropLiteApplet.txtDownloadTarget.text=
iDropLiteApplet.bntBeginDownload.text=Begin Download
-iDropLiteApplet.btnCancelDownload.text=Cancel
iDropLiteApplet.btnBrowseDownloadTarget.text=Browse
iDropLiteApplet.txtIdropWebModeDownloadTarget.text=
iDropLiteApplet.btnIdropWebModeTargetBrowse.text=Browse