public class Cockpit extends javax.swing.JApplet implements S3ServiceEventListener, java.awt.event.ActionListener, javax.swing.event.ListSelectionListener, HyperlinkActivatedListener, org.apache.http.client.CredentialsProvider
This is the Cockpit application class; it may be run as a stand-alone application or as an Applet.
| Modifier and Type | Class and Description |
|---|---|
private class |
Cockpit.ContextMenuListener |
javax.swing.JApplet.AccessibleJAppletjava.applet.Applet.AccessibleApplet| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AMAZON_S3_PAGE |
private javax.swing.JMenuItem |
amazonS3HelpMenuItem |
static java.lang.String |
APPLICATION_DESCRIPTION |
static java.lang.String |
APPLICATION_TITLE |
private static int |
BUCKET_LIST_CHUNKING_SIZE |
private javax.swing.JPopupMenu |
bucketActionMenu |
private javax.swing.JMenuItem |
bucketLoggingMenuItem |
private javax.swing.JTable |
bucketsTable |
private BucketTableModel |
bucketTableModel |
private TableSorter |
bucketTableModelSorter |
private ByteFormatter |
byteFormatter |
private java.util.HashMap |
cachedBuckets |
private boolean |
cloudFrontMembershipChecked |
private CloudFrontService |
cloudFrontService |
private javax.swing.JMenuItem |
cockpitHelpMenuItem |
private java.io.File |
cockpitHomeDirectory |
private CockpitPreferences |
cockpitPreferences |
private Jets3tProperties |
cockpitProperties |
private javax.swing.JMenuItem |
copyObjectsMenuItem |
private javax.swing.JMenuItem |
createBucketMenuItem |
private S3Bucket |
currentSelectedBucket |
private javax.swing.JMenuItem |
deleteBucketMenuItem |
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 EncryptionUtil |
encryptionUtil |
private java.io.File |
fileChoosersLastUploadDirectory |
private javax.swing.JCheckBox |
filterObjectsCheckBox |
private javax.swing.JComboBox |
filterObjectsDelimiter |
private javax.swing.JPanel |
filterObjectsPanel |
private javax.swing.JTextField |
filterObjectsPrefix |
private javax.swing.JMenuItem |
generatePublicGetUrls |
private javax.swing.JMenuItem |
generateTorrentUrl |
private GuiUtils |
guiUtils |
private java.awt.Insets |
insetsDefault |
private java.awt.Insets |
insetsZero |
private boolean |
isStandAloneApplication |
private boolean |
isTargetS3
Multi-threaded S3 service used by the application.
|
static java.lang.String |
JETS3T_COCKPIT_HELP_PAGE |
private static org.apache.commons.logging.Log |
log |
private java.util.HashMap<java.lang.String,ProviderCredentials> |
loginAwsCredentialsMap |
private javax.swing.JMenuItem |
loginMenuItem |
private javax.swing.JMenu |
loginSwitchMenu |
private javax.swing.JMenuItem |
logoutMenuItem |
private javax.swing.JMenuItem |
manageDistributionsMenuItem |
private org.apache.http.client.CredentialsProvider |
mCredentialProvider |
private javax.swing.JPopupMenu |
objectActionMenu |
private ObjectsAttributesDialog |
objectsAttributesDialog |
private javax.swing.JLabel |
objectsSummaryLabel |
private javax.swing.JTable |
objectsTable |
private javax.swing.JScrollPane |
objectsTableSP |
private ObjectTableModel |
objectTableModel |
private TableSorter |
objectTableModelSorter |
private java.lang.String |
originalTargetEndpoint |
static java.lang.String |
OS_NAME_MAC |
private javax.swing.JFrame |
ownerFrame |
private javax.swing.JMenuItem |
preferencesDialogMenuItem |
private ProgressDialog |
progressDialog |
private javax.swing.JMenuItem |
refreshBucketMenuItem |
private javax.swing.JMenuItem |
refreshObjectMenuItem |
private S3ServiceMulti |
s3ServiceMulti |
private static long |
serialVersionUID |
private SkinsFactory |
skinsFactory |
private TimeFormatter |
timeFormatter |
private java.text.SimpleDateFormat |
timeSDF |
private javax.swing.JMenuItem |
updateBucketACLMenuItem |
private javax.swing.JMenuItem |
updateBucketRequesterPaysStatusMenuItem |
private javax.swing.JMenuItem |
updateObjectACLMenuItem |
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 javax.swing.JMenuItem |
viewBucketPropertiesMenuItem |
private javax.swing.JMenuItem |
viewOrModifyObjectAttributesMenuItem |
private java.text.SimpleDateFormat |
yearAndTimeSDF |
accessibleContext, rootPane, rootPaneCheckingEnabled| Constructor and Description |
|---|
Cockpit()
Constructor to run this application as an Applet.
|
Cockpit(javax.swing.JFrame ownerFrame)
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.
|
private void |
addThirdPartyBucket()
Adds a bucket not owned by the current S3 user to the bucket listing, after
prompting the user for the name of the bucket to add.
|
private void |
bucketSelectedAction()
Actions performed when a bucket is selected in the bucket list table.
|
private DownloadPackage[] |
buildDownloadPackageList(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 S3Object[] |
buildUploadObjectsList(FileComparerResults comparisonResults,
java.util.Map<java.lang.String,java.lang.String> objectKeyToFilepathMap) |
void |
clear()
Clear credentials.
|
private FileComparerResults |
compareRemoteAndLocalFiles(java.util.Map<java.lang.String,java.lang.String> objectKeyToFilepathMap,
java.util.Map s3ObjectsMap) |
private void |
copyObjects() |
private void |
createBucketAction()
Action to create a new bucket in S3 after prompting the user for a bucket name.
|
private void |
deleteSelectedBucket()
Deletes the bucket currently selected in the gui.
|
private void |
deleteSelectedObjects() |
private void |
displayAclModificationDialog() |
private void |
displayObjectsAttributesDialog()
Displays the currently selected object's properties in the dialog
ObjectsAttributesDialog. |
private void |
downloadSelectedObjects()
Downloads the objects currently selected in the objects table.
|
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 |
generatePublicGetUrls() |
private void |
generateTorrentUrl() |
org.apache.http.auth.Credentials |
getCredentials(org.apache.http.auth.AuthScope scope)
Implementation method for the CredentialsProvider interface.
|
protected RestS3Service |
getRestS3Service(ProviderCredentials credentials) |
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 void |
initMenus()
Initialise the application's menu bar.
|
private boolean |
isObjectFilteringActive() |
private void |
listAllBuckets()
Lists the buckets in the user's S3 account and refreshes the GUI to display
these buckets.
|
private void |
listBucketProperties()
Displays the currently selected bucket's properties in the dialog
ItemPropertiesDialog. |
private void |
listObjects()
Starts a thread to run
S3ServiceMulti.listObjects(java.lang.String, java.lang.String[], java.lang.String, long). |
private void |
loginEvent(ProviderCredentials credentials)
Displays the
StartupDialog dialog and, if the user provides login credentials,
logs into the S3 service using those credentials. |
private void |
logoutEvent()
Logs out of the S3 service by clearing all listed objects and buckets and resetting
the s3ServiceMulti member variable.
|
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 boolean |
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[]). |
private void |
runInBackgroundThread(java.lang.Runnable runnable)
Run the provided Runnable object in a background thread.
|
private boolean |
runInDispatcherThreadImmediately(java.lang.Runnable runnable)
Run the provided runnable in the application's event dispatcher thread,
and wait for the action to complete before returning.
|
void |
s3ServiceEventPerformed(CopyObjectsEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a CopyObjectsEvent. |
void |
s3ServiceEventPerformed(CreateBucketsEvent event)
This method is an
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a CreateBucketsEvent. |
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 |
showBucketPopupMenu(javax.swing.JComponent invoker,
int xPos,
int yPos)
Displays bucket-specific actions in a popup menu.
|
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 statusText)
Starts a progress display dialog that cannot be cancelled.
|
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.
|
private void |
stopProgressDialog()
Stops/halts the progress display dialog and allows the user to interact with the application.
|
private void |
updateBucketAccessControlList()
Updates the ACL settings for the currently selected bucket.
|
private void |
updateBucketRequesterPaysSetting()
Updates the ACL settings for the currently selected bucket.
|
private void |
updateObjectsSummary(boolean isIncompleteListing)
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.
|
private void |
uploadFiles(java.io.File[] uploadFiles) |
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
public static final java.lang.String JETS3T_COCKPIT_HELP_PAGE
public static final java.lang.String AMAZON_S3_PAGE
public static final java.lang.String OS_NAME_MAC
public static final java.lang.String APPLICATION_DESCRIPTION
public static final java.lang.String APPLICATION_TITLE
private static final int BUCKET_LIST_CHUNKING_SIZE
private final java.io.File cockpitHomeDirectory
private CockpitPreferences cockpitPreferences
private final java.awt.Insets insetsZero
private final java.awt.Insets insetsDefault
private final ByteFormatter byteFormatter
private final TimeFormatter timeFormatter
private final java.text.SimpleDateFormat yearAndTimeSDF
private final java.text.SimpleDateFormat timeSDF
private final GuiUtils guiUtils
private boolean isTargetS3
private java.lang.String originalTargetEndpoint
private S3ServiceMulti s3ServiceMulti
private CloudFrontService cloudFrontService
private boolean cloudFrontMembershipChecked
private javax.swing.JFrame ownerFrame
private boolean isStandAloneApplication
private javax.swing.JMenuItem loginMenuItem
private javax.swing.JMenuItem logoutMenuItem
private javax.swing.JMenu loginSwitchMenu
private javax.swing.JPopupMenu bucketActionMenu
private javax.swing.JMenuItem viewBucketPropertiesMenuItem
private javax.swing.JMenuItem refreshBucketMenuItem
private javax.swing.JMenuItem createBucketMenuItem
private javax.swing.JMenuItem manageDistributionsMenuItem
private javax.swing.JMenuItem updateBucketACLMenuItem
private javax.swing.JMenuItem updateBucketRequesterPaysStatusMenuItem
private javax.swing.JMenuItem deleteBucketMenuItem
private javax.swing.JPopupMenu objectActionMenu
private javax.swing.JMenuItem refreshObjectMenuItem
private javax.swing.JMenuItem viewOrModifyObjectAttributesMenuItem
private javax.swing.JMenuItem copyObjectsMenuItem
private javax.swing.JMenuItem updateObjectACLMenuItem
private javax.swing.JMenuItem downloadObjectMenuItem
private javax.swing.JMenuItem uploadFilesMenuItem
private javax.swing.JMenuItem generatePublicGetUrls
private javax.swing.JMenuItem generateTorrentUrl
private javax.swing.JMenuItem deleteObjectMenuItem
private javax.swing.JMenuItem bucketLoggingMenuItem
private javax.swing.JMenuItem preferencesDialogMenuItem
private javax.swing.JMenuItem cockpitHelpMenuItem
private javax.swing.JMenuItem amazonS3HelpMenuItem
private javax.swing.JTable bucketsTable
private javax.swing.JTable objectsTable
private javax.swing.JScrollPane objectsTableSP
private BucketTableModel bucketTableModel
private TableSorter bucketTableModelSorter
private ObjectTableModel objectTableModel
private TableSorter objectTableModelSorter
private javax.swing.JLabel objectsSummaryLabel
private final java.util.HashMap cachedBuckets
private ProgressDialog progressDialog
private ObjectsAttributesDialog objectsAttributesDialog
private java.io.File downloadDirectory
private java.io.File fileChoosersLastUploadDirectory
private javax.swing.JPanel filterObjectsPanel
private javax.swing.JCheckBox filterObjectsCheckBox
private javax.swing.JTextField filterObjectsPrefix
private javax.swing.JComboBox filterObjectsDelimiter
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 EncryptionUtil encryptionUtil
private Jets3tProperties cockpitProperties
private SkinsFactory skinsFactory
private S3Bucket currentSelectedBucket
private final java.util.HashMap<java.lang.String,ProviderCredentials> loginAwsCredentialsMap
private final org.apache.http.client.CredentialsProvider mCredentialProvider
public Cockpit()
public Cockpit(javax.swing.JFrame ownerFrame)
throws S3ServiceException
ownerFrame - the frame the application will be displayed inS3ServiceExceptionprotected RestS3Service getRestS3Service(ProviderCredentials credentials) throws S3ServiceException
S3ServiceExceptionpublic void init()
RestS3Service and loading properties files.init in class java.applet.Appletprivate void initGui()
private void initMenus()
private void initDropTarget(javax.swing.JComponent[] dropTargetComponents)
dropTargetComponents - the components files can be dropped on to transfer them to S3private void runInBackgroundThread(java.lang.Runnable runnable)
private boolean runInDispatcherThreadImmediately(java.lang.Runnable runnable)
runnable - private void startProgressDialog(java.lang.String statusText)
statusText - describes the status of a task in text meaningful to the userprivate 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()
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 loginEvent(ProviderCredentials credentials)
StartupDialog dialog and, if the user provides login credentials,
logs into the S3 service using those credentials.
This method should always be run within the event dispatcher thread.private void logoutEvent()
private void listBucketProperties()
ItemPropertiesDialog.private void displayObjectsAttributesDialog()
ObjectsAttributesDialog.
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 dialog as the #isViewingOrModifyingObjectProperties flag is set.
private void listAllBuckets()
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 bucketSelectedAction()
private void objectSelectedAction()
private void listObjects()
S3ServiceMulti.listObjects(java.lang.String, java.lang.String[], java.lang.String, long).private void updateObjectsSummary(boolean isIncompleteListing)
private void showBucketPopupMenu(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 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 void createBucketAction()
public void s3ServiceEventPerformed(CreateBucketsEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a CreateBucketsEvent.
When a bucket is successfully created it is added to the listing of buckets.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - private void deleteSelectedBucket()
private void addThirdPartyBucket()
private void updateBucketAccessControlList()
private void updateBucketRequesterPaysSetting()
private S3Object[] getSelectedObjects()
private void displayAclModificationDialog()
public void s3ServiceEventPerformed(LookupACLEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a LookupACLEvent.
The ACL details are retrieved for the currently selected objects in the gui, then the
AccessControlDialog is displayed to allow the user to update the ACL settings
for these objects.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - 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()
java.io.IOExceptionprivate void uploadFiles(java.io.File[] uploadFiles)
private FileComparerResults compareRemoteAndLocalFiles(java.util.Map<java.lang.String,java.lang.String> objectKeyToFilepathMap, java.util.Map s3ObjectsMap) throws java.lang.Exception
java.lang.Exceptionprivate DownloadPackage[] buildDownloadPackageList(FileComparerResults comparisonResults, java.util.Map s3DownloadObjectsMap) throws java.lang.Exception
S3ServiceMulti.downloadObjects(org.jets3t.service.model.S3Bucket, org.jets3t.service.multithread.DownloadPackage[]) where the real work is done.java.lang.Exceptionpublic 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 S3Object[] buildUploadObjectsList(FileComparerResults comparisonResults, java.util.Map<java.lang.String,java.lang.String> objectKeyToFilepathMap) throws java.lang.Exception
java.lang.Exceptionpublic 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 copyObjects()
public void s3ServiceEventPerformed(CopyObjectsEvent event)
S3ServiceEventListener action method that is invoked when this
application's S3ServiceMulti triggers a CopyObjectsEvent.
This method merely updates the progress dialog as objects are copied.
s3ServiceEventPerformed in interface S3ServiceEventListenerevent - private void generatePublicGetUrls()
private void generateTorrentUrl()
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 - private boolean 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 - 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 static void main(java.lang.String[] args)
throws java.lang.Exception
args - java.lang.Exception