public class CockpitLite extends javax.swing.JApplet implements S3ServiceEventListener, java.awt.event.ActionListener, javax.swing.event.ListSelectionListener, HyperlinkActivatedListener, org.apache.http.client.CredentialsProvider
This is the CockpitLite application class; it may be run as a stand-alone application or as an Applet.
| Modifier and Type | Class and Description |
|---|---|
private class |
CockpitLite.ContextMenuListener |
javax.swing.JApplet.AccessibleJAppletjava.applet.Applet.AccessibleApplet| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
ACL_PRIVATE_DESCRIPTION |
private static java.lang.String |
ACL_PUBLIC_DESCRIPTION |
private static java.lang.String |
ACL_UNKNOWN_DESCRIPTION |
static java.lang.String |
APPLICATION_DESCRIPTION |
static java.lang.String |
APPLICATION_TITLE |
private ByteFormatter |
byteFormatter |
private ByteFormatter |
byteFormatterTerse |
private Jets3tProperties |
cockpitLiteProperties |
private javax.swing.JMenuItem |
deleteObjectMenuItem |
private static java.lang.String |
DOWNLOAD_ALL_FILES |
private static java.lang.String |
DOWNLOAD_NEW_AND_CHANGED_FILES |
private static java.lang.String |
DOWNLOAD_NEW_FILES_ONLY |
private java.io.File |
downloadDirectory |
private javax.swing.JMenuItem |
downloadObjectMenuItem |
private java.util.Map |
downloadObjectsToFileMap |
private java.io.File |
fileChoosersLastUploadDirectory |
private java.util.Map |
filesAlreadyInDownloadDirectoryMap |
private javax.swing.JCheckBox |
filterObjectsCheckBox |
private javax.swing.JPanel |
filterObjectsPanel |
private javax.swing.JTextField |
filterObjectsPrefix |
private javax.swing.JMenuItem |
generatePublicGetUrl |
private GatekeeperClientUtils |
gkClient |
private GuiUtils |
guiUtils |
static int |
HTTP_CONNECTION_TIMEOUT |
private java.awt.Insets |
insetsDefault |
private java.awt.Insets |
insetsZero |
private boolean |
isDownloadingObjects |
private boolean |
isRunningAsApplet |
private boolean |
isStandAloneApplication |
private boolean |
isUploadingFiles |
private boolean |
isViewingObjectProperties
Flag used to indicate the "viewing objects" application state.
|
private java.lang.Object |
lock |
private static org.apache.commons.logging.Log |
log |
private javax.swing.JButton |
loginButton |
private javax.swing.JPanel |
loginPanel |
static int |
MAX_CONNECTION_RETRIES |
private org.apache.http.client.CredentialsProvider |
mCredentialProvider |
private javax.swing.JPopupMenu |
objectActionMenu |
private java.util.Map<java.lang.String,java.lang.String> |
objectKeyToFilepathMap |
private javax.swing.JLabel |
objectsHeadingLabel |
private javax.swing.JLabel |
objectsSummaryLabel |
private javax.swing.JTable |
objectsTable |
private javax.swing.JScrollPane |
objectsTableSP |
private CLObjectTableModel |
objectTableModel |
private TableSorter |
objectTableModelSorter |
private java.awt.Frame |
ownerFrame |
private ProgressDialog |
progressDialog |
private javax.swing.JPanel |
progressNotificationPanel |
private java.util.Map |
progressPanelMap
Stores the active ProgressPanel objects that track event progress.
|
private static java.lang.String |
PROPERTIES_FILENAME |
private javax.swing.JMenuItem |
refreshObjectMenuItem |
private java.util.Map |
s3DownloadObjectsMap |
private java.util.Map |
s3ExistingObjectsMap |
private S3ServiceMulti |
s3ServiceMulti
Multi-threaded S3 service used by the application.
|
private static long |
serialVersionUID |
private SkinsFactory |
skinsFactory |
static int |
SOCKET_CONNECTION_TIMEOUT |
private javax.swing.JPanel |
stackPanel |
private java.awt.CardLayout |
stackPanelCardLayout |
private java.util.Properties |
standAloneArgumentProperties
Properties set in stand-alone application from the command line arguments.
|
private TimeFormatter |
timeFormatterTerse |
private java.text.SimpleDateFormat |
timeSDF |
private javax.swing.JMenuItem |
togglePublicMenuItem |
private static java.lang.String |
UPLOAD_ALL_FILES |
private static java.lang.String |
UPLOAD_NEW_AND_CHANGED_FILES |
private static java.lang.String |
UPLOAD_NEW_FILES_ONLY |
private javax.swing.JMenuItem |
uploadFilesMenuItem |
private java.lang.String |
userBucketName |
private boolean |
userCanACL |
private boolean |
userCanDelete |
private boolean |
userCanDownload |
private boolean |
userCanUpload |
private UserInputFields |
userInputFields |
private java.lang.String |
userPath |
private java.lang.String |
userVanityHost |
private javax.swing.JMenuItem |
viewObjectPropertiesMenuItem |
private java.text.SimpleDateFormat |
yearAndTimeSDF |
accessibleContext, rootPane, rootPaneCheckingEnabled| Constructor and Description |
|---|
CockpitLite()
Constructor to run this application as an Applet.
|
CockpitLite(javax.swing.JFrame ownerFrame,
java.util.Properties standAloneArgumentProperties)
Constructor to run this application in a stand-alone window.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
Event handler for this application, handles all menu items.
|
void |
clear()
Clear credentials.
|
private void |
compareRemoteAndLocalFiles(java.util.Map<java.lang.String,java.lang.String> objectKeyToFilepathMap,
java.util.Map s3ObjectsMap,
boolean upload) |
private void |
deleteSelectedObjects() |
private void |
downloadSelectedObjects()
Prepares to perform a download of objects from S3 by prompting the user for a directory
to store the files in, then performing the download.
|
void |
followHyperlink(java.net.URL url,
java.lang.String target)
Follows hyperlinks clicked on by a user.
|
private java.lang.String |
formatBytesProgressWatcherDetails(BytesProgressWatcher watcher,
boolean includeBytes) |
private java.lang.String |
formatTransferDetails(ThreadWatcher watcher) |
private void |
generatePublicGetUrl() |
static java.lang.String |
getAclDescription(AccessControlList acl) |
org.apache.http.auth.Credentials |
getCredentials(org.apache.http.auth.AuthScope scope)
Implementation method for the CredentialsProvider interface.
|
private S3Object[] |
getSelectedObjects() |
void |
init()
Prepares application to run as a GUI by finding/creating a root owner JFrame, creating an
un-authenticated
RestS3Service and loading properties files. |
private void |
initDropTarget(javax.swing.JComponent[] dropTargetComponents)
Initialise the application's File drop targets for drag and drop copying of local files
to S3.
|
private void |
initGui()
Initialises the application's GUI elements.
|
private boolean |
isObjectFilteringActive() |
private void |
listObjectProperties()
Displays the currently selected object's properties in the dialog
ItemPropertiesDialog. |
private void |
listObjects() |
private void |
lookupObjectsAccessControlLists(S3Object[] objects)
Retrieves ACL settings for the currently selected objects.
|
static void |
main(java.lang.String[] args)
Runs Cockpit as a stand-alone application.
|
private void |
objectSelectedAction()
Actions performed when an object is selected in the objects list table.
|
private void |
performFilesUpload(FileComparerResults comparisonResults,
java.util.Map<java.lang.String,java.lang.String> objectKeyToFilepathMap) |
private void |
performObjectsDownload(FileComparerResults comparisonResults,
java.util.Map s3DownloadObjectsMap)
Performs the real work of downloading files by comparing the download candidates against
existing files, prompting the user whether to overwrite any pre-existing file versions,
and starting
S3ServiceMulti.downloadObjects(org.jets3t.service.model.S3Bucket, org.jets3t.service.multithread.DownloadPackage[]) where the real work is done. |
private void |
prepareForFilesUpload(java.io.File[] uploadFiles) |
private void |
prepareForObjectsDownload() |
private SignatureRequest[] |
requestSignedRequests(java.lang.String operationType,
S3Object[] objects) |
private void |
retrieveObjectsDetails(S3Object[] candidateObjects)
Retrieves details about objects including metadata etc by invoking the method
S3ServiceMulti.getObjectsHeads(org.jets3t.service.model.S3Bucket, org.jets3t.service.model.S3Object[]). |
void |
s3ServiceEventPerformed(CopyObjectsEvent event) |
void |
s3ServiceEventPerformed(CreateBucketsEvent event) |
void |
s3ServiceEventPerformed(CreateObjectsEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a CreateObjectsEvent. |
void |
s3ServiceEventPerformed(DeleteObjectsEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a DeleteObjectsEvent. |
void |
s3ServiceEventPerformed(DeleteVersionedObjectsEvent event) |
void |
s3ServiceEventPerformed(DownloadObjectsEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a DownloadObjectsEvent. |
void |
s3ServiceEventPerformed(GetObjectHeadsEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a GetObjectHeadsEvent. |
void |
s3ServiceEventPerformed(GetObjectsEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a GetObjectsEvent. |
void |
s3ServiceEventPerformed(ListObjectsEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a ListObjectsEvent. |
void |
s3ServiceEventPerformed(LookupACLEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a LookupACLEvent. |
void |
s3ServiceEventPerformed(UpdateACLEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a UpdateACLEvent. |
void |
setCredentials(org.apache.http.auth.AuthScope authscope,
org.apache.http.auth.Credentials credentials) |
private void |
showObjectPopupMenu(javax.swing.JComponent invoker,
int xPos,
int yPos)
Displays object-specific actions in a popup menu.
|
private void |
startProgressDialog(java.lang.String statusMessage,
java.lang.String detailsText,
int minTaskValue,
int maxTaskValue,
java.lang.String cancelButtonText,
CancelEventTrigger cancelEventListener)
Starts a progress display dialog.
|
protected void |
startProgressPanel(java.lang.Object operationId,
java.lang.String statusMessage,
int maxCount,
CancelEventTrigger cancelEventTrigger) |
private void |
stopProgressDialog()
Stops/halts the progress display dialog and allows the user to interact with the application.
|
protected void |
stopProgressPanel(java.lang.Object operationId) |
private void |
updateObjectsAccessControlLists(S3Object[] objectsToUpdate,
AccessControlList acl)
Updates ACL settings for the currently selected objects.
|
private void |
updateObjectsSummary()
Updates the summary text shown below the listing of objects, which details the
number and total size of the objects.
|
private void |
updateProgressDialog(java.lang.String statusMessage,
java.lang.String detailsText,
int progressValue)
Updates the status text and value of the progress display dialog.
|
protected void |
updateProgressPanel(java.lang.Object operationId,
java.lang.String statusMessage,
int currentCount) |
void |
valueChanged(javax.swing.event.ListSelectionEvent e)
Handles list selection events for this application.
|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updatedestroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stopadd, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprivate static final long serialVersionUID
private static final org.apache.commons.logging.Log log
private static final java.lang.String PROPERTIES_FILENAME
public static final java.lang.String APPLICATION_DESCRIPTION
public static final java.lang.String APPLICATION_TITLE
private final java.awt.Insets insetsZero
private final java.awt.Insets insetsDefault
private final ByteFormatter byteFormatter
private final ByteFormatter byteFormatterTerse
private final TimeFormatter timeFormatterTerse
private final java.text.SimpleDateFormat yearAndTimeSDF
private final java.text.SimpleDateFormat timeSDF
private final GuiUtils guiUtils
private Jets3tProperties cockpitLiteProperties
private static final java.lang.String ACL_PRIVATE_DESCRIPTION
private static final java.lang.String ACL_PUBLIC_DESCRIPTION
private static final java.lang.String ACL_UNKNOWN_DESCRIPTION
private java.util.Properties standAloneArgumentProperties
private final java.util.Map progressPanelMap
private final java.lang.Object lock
private S3ServiceMulti s3ServiceMulti
private GatekeeperClientUtils gkClient
private final org.apache.http.client.CredentialsProvider mCredentialProvider
private java.lang.String userBucketName
private java.lang.String userVanityHost
private java.lang.String userPath
private boolean userCanUpload
private boolean userCanDownload
private boolean userCanDelete
private boolean userCanACL
private boolean isRunningAsApplet
private java.awt.Frame ownerFrame
private boolean isStandAloneApplication
private SkinsFactory skinsFactory
public static final int HTTP_CONNECTION_TIMEOUT
public static final int SOCKET_CONNECTION_TIMEOUT
public static final int MAX_CONNECTION_RETRIES
private javax.swing.JPanel stackPanel
private java.awt.CardLayout stackPanelCardLayout
private javax.swing.JPopupMenu objectActionMenu
private javax.swing.JMenuItem viewObjectPropertiesMenuItem
private javax.swing.JMenuItem refreshObjectMenuItem
private javax.swing.JMenuItem togglePublicMenuItem
private javax.swing.JMenuItem downloadObjectMenuItem
private javax.swing.JMenuItem uploadFilesMenuItem
private javax.swing.JMenuItem generatePublicGetUrl
private javax.swing.JMenuItem deleteObjectMenuItem
private javax.swing.JPanel loginPanel
private javax.swing.JButton loginButton
private javax.swing.JLabel objectsHeadingLabel
private javax.swing.JTable objectsTable
private javax.swing.JScrollPane objectsTableSP
private CLObjectTableModel objectTableModel
private TableSorter objectTableModelSorter
private javax.swing.JPanel progressNotificationPanel
private javax.swing.JLabel objectsSummaryLabel
private ProgressDialog progressDialog
private UserInputFields userInputFields
private java.io.File downloadDirectory
private java.util.Map downloadObjectsToFileMap
private boolean isDownloadingObjects
private boolean isUploadingFiles
private java.util.Map filesAlreadyInDownloadDirectoryMap
private java.util.Map s3DownloadObjectsMap
private java.util.Map<java.lang.String,java.lang.String> objectKeyToFilepathMap
private java.util.Map s3ExistingObjectsMap
private java.io.File fileChoosersLastUploadDirectory
private javax.swing.JPanel filterObjectsPanel
private javax.swing.JCheckBox filterObjectsCheckBox
private javax.swing.JTextField filterObjectsPrefix
private static final java.lang.String UPLOAD_NEW_FILES_ONLY
private static final java.lang.String UPLOAD_NEW_AND_CHANGED_FILES
private static final java.lang.String UPLOAD_ALL_FILES
private static final java.lang.String DOWNLOAD_NEW_FILES_ONLY
private static final java.lang.String DOWNLOAD_NEW_AND_CHANGED_FILES
private static final java.lang.String DOWNLOAD_ALL_FILES
private boolean isViewingObjectProperties
public CockpitLite()
public CockpitLite(javax.swing.JFrame ownerFrame,
java.util.Properties standAloneArgumentProperties)
throws S3ServiceException
ownerFrame - the frame the application will be displayed inS3ServiceExceptionpublic void init()
RestS3Service and loading properties files.init in class java.applet.Appletprivate void initGui()
private void initDropTarget(javax.swing.JComponent[] dropTargetComponents)
dropTargetComponents - the components files can be dropped on to transfer them to S3private void startProgressDialog(java.lang.String statusMessage,
java.lang.String detailsText,
int minTaskValue,
int maxTaskValue,
java.lang.String cancelButtonText,
CancelEventTrigger cancelEventListener)
statusMessage - describes the status of a task text meaningful to the user, such as "3 files of 7 uploaded"detailsText - describes the status of a task in more detail, such as the current transfer rate and Time remaining.minTaskValue - the minimum progress value for a task, generally 0maxTaskValue - the maximum progress value for a task, such as the total number of threads or 100 if
using percentage-complete as a metric.cancelEventListener - listener that is responsible for cancelling a long-lived task when the user clicks
the cancel button. If a task cannot be cancelled this must be null.cancelButtonText - text displayed in the cancel button if a task can be cancelled. This is only used if
a cancel event listener is provided.private void updateProgressDialog(java.lang.String statusMessage,
java.lang.String detailsText,
int progressValue)
statusMessage - describes the status of a task text meaningful to the user, such as "3 files of 7 uploaded"detailsText - describes the status of a task in more detail, such as the current transfer rate and time remaining.progressValue - value representing how far through the task we are (relative to min and max values)private void stopProgressDialog()
protected void startProgressPanel(java.lang.Object operationId,
java.lang.String statusMessage,
int maxCount,
CancelEventTrigger cancelEventTrigger)
protected void updateProgressPanel(java.lang.Object operationId,
java.lang.String statusMessage,
int currentCount)
protected void stopProgressPanel(java.lang.Object operationId)
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed in interface java.awt.event.ActionListenerpublic void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged in interface javax.swing.event.ListSelectionListenerprivate void listObjects()
private void listObjectProperties()
ItemPropertiesDialog.
As detailed information about the object may not yet be available, this method works
indirectly via the retrieveObjectsDetails(org.jets3t.service.model.S3Object[]) method. The retrieveObjectsDetails
method retrieves all the details for the currently selected objects, and once they are available
knows to display the PropertiesDialog as the isViewingObjectProperties flag
is set.
public void s3ServiceEventPerformed(GetObjectsEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a GetObjectsEvent.
This never happens in this application as downloads are performed by
S3ServiceMulti.downloadObjects(S3Bucket, DownloadPackage[]) instead.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - public void s3ServiceEventPerformed(ListObjectsEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a ListObjectsEvent.
This never happens in this application as it does not perform multi-threaded object listings.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - public void s3ServiceEventPerformed(DeleteVersionedObjectsEvent event)
s3ServiceEventPerformed in interface S3ServiceEventListenerprivate void objectSelectedAction()
private void updateObjectsSummary()
private void showObjectPopupMenu(javax.swing.JComponent invoker,
int xPos,
int yPos)
invoker - the component near which the popup menu will be displayedxPos - the mouse's horizontal co-ordinate when the popup menu was invokedyPos - the mouse's vertical co-ordinate when the popup menu was invokedprivate S3Object[] getSelectedObjects()
private void lookupObjectsAccessControlLists(S3Object[] objects)
s3ServiceEventPerformed method specific to LookupACLEvents.public void s3ServiceEventPerformed(LookupACLEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a LookupACLEvent.s3ServiceEventPerformed in interface S3ServiceEventListenerevent - private void updateObjectsAccessControlLists(S3Object[] objectsToUpdate, AccessControlList acl)
s3ServiceEventPerformed method specific to UpdateACLEvents.public void s3ServiceEventPerformed(UpdateACLEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a UpdateACLEvent.
This method merely updates the progress dialog as ACLs are updated.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - private void downloadSelectedObjects()
throws java.io.IOException
java.io.IOExceptionprivate void prepareForObjectsDownload()
private void prepareForFilesUpload(java.io.File[] uploadFiles)
private void compareRemoteAndLocalFiles(java.util.Map<java.lang.String,java.lang.String> objectKeyToFilepathMap,
java.util.Map s3ObjectsMap,
boolean upload)
private void retrieveObjectsDetails(S3Object[] candidateObjects)
S3ServiceMulti.getObjectsHeads(org.jets3t.service.model.S3Bucket, org.jets3t.service.model.S3Object[]).
This is generally done as a prelude
to some further action, such as displaying the objects' details or downloading the objects.
The real action occurs in the method s3ServiceEventPerformed for handling
GetObjectHeadsEvent events.candidateObjects - private void performObjectsDownload(FileComparerResults comparisonResults, java.util.Map s3DownloadObjectsMap)
S3ServiceMulti.downloadObjects(org.jets3t.service.model.S3Bucket, org.jets3t.service.multithread.DownloadPackage[]) where the real work is done.private SignatureRequest[] requestSignedRequests(java.lang.String operationType, S3Object[] objects)
public void s3ServiceEventPerformed(DownloadObjectsEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a DownloadObjectsEvent.
This method merely updates the progress dialog as objects are downloaded.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - private void performFilesUpload(FileComparerResults comparisonResults, java.util.Map<java.lang.String,java.lang.String> objectKeyToFilepathMap)
public void s3ServiceEventPerformed(CreateObjectsEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a CreateObjectsEvent.
This method merely updates the progress dialog as files are uploaded.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - private void generatePublicGetUrl()
private void deleteSelectedObjects()
public void s3ServiceEventPerformed(DeleteObjectsEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a DeleteObjectsEvent.
This method merely updates the progress dialog as objects are deleted.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - public void s3ServiceEventPerformed(GetObjectHeadsEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a GetObjectHeadsEvent.
This method merely updates the progress dialog as object details (heads) are retrieved.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - private java.lang.String formatTransferDetails(ThreadWatcher watcher)
private java.lang.String formatBytesProgressWatcherDetails(BytesProgressWatcher watcher, boolean includeBytes)
public void followHyperlink(java.net.URL url,
java.lang.String target)
followHyperlink in interface HyperlinkActivatedListenerurl - the url to opentarget - the target pane to open the url in, eg "_blank". This may be null.public void setCredentials(org.apache.http.auth.AuthScope authscope,
org.apache.http.auth.Credentials credentials)
setCredentials in interface org.apache.http.client.CredentialsProviderpublic void clear()
clear in interface org.apache.http.client.CredentialsProviderpublic org.apache.http.auth.Credentials getCredentials(org.apache.http.auth.AuthScope scope)
Based on sample code: InteractiveAuthenticationExample
getCredentials in interface org.apache.http.client.CredentialsProviderprivate boolean isObjectFilteringActive()
public void s3ServiceEventPerformed(CreateBucketsEvent event)
s3ServiceEventPerformed in interface S3ServiceEventListenerpublic void s3ServiceEventPerformed(CopyObjectsEvent event)
s3ServiceEventPerformed in interface S3ServiceEventListenerpublic static java.lang.String getAclDescription(AccessControlList acl)
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - java.lang.Exception