Package org.jets3t.apps.uploader
Class Uploader
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
javax.swing.JApplet
org.jets3t.apps.uploader.Uploader
- All Implemented Interfaces:
ActionListener
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
,ListSelectionListener
,RootPaneContainer
,org.apache.commons.httpclient.auth.CredentialsProvider
,HyperlinkActivatedListener
,S3ServiceEventListener
public class Uploader
extends JApplet
implements S3ServiceEventListener, ActionListener, ListSelectionListener, HyperlinkActivatedListener, org.apache.commons.httpclient.auth.CredentialsProvider
Dual application and applet for uploading files and XML metadata information to the Amazon S3
service.
For more information and help please see the Uploader Guide.
The Uploader is highly configurable through properties specified in a file uploader.properties. This file must be available at the root of the classpath.
- Author:
- James Murty
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final int
static final int
static final int
static final String
static final int
static final int
static final int
static final int
static final int
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface org.apache.commons.httpclient.auth.CredentialsProvider
PROVIDER
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
ConstructorsConstructorDescriptionUploader()
Constructor to run this application as an Applet.Uploader
(JFrame ownerFrame, Properties standAloneArgumentProperties) Constructor to run this application in a stand-alone window. -
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerformed
(ActionEvent actionEvent) Handles GUI actions.void
followHyperlink
(URL url, String target) Follows hyperlinks clicked on by a user.org.apache.commons.httpclient.Credentials
getCredentials
(org.apache.commons.httpclient.auth.AuthScheme authscheme, String host, int port, boolean proxy) Implementation method for the CredentialsProvider interface.void
init()
Prepares application to run as a GUI by finding/creating a root owner JFrame, and (if necessary) creating a directory for storing remembered logins.static void
Run the Uploader as a stand-alone application.void
void
void
Listener method that responds to events from the jets3t toolkit when objects are created in S3 - ie when files are uploaded.void
void
void
void
void
void
void
void
void
Methods inherited from class javax.swing.JApplet
getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
Methods inherited from class java.applet.Applet
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, isValidateRoot, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
Methods inherited from class java.awt.Container
add, 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, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, 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, 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, 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, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
APPLICATION_DESCRIPTION
- See Also:
-
UPLOADER_PROPERTIES_FILENAME
- See Also:
-
WIZARD_SCREEN_1
public static final int WIZARD_SCREEN_1- See Also:
-
WIZARD_SCREEN_2
public static final int WIZARD_SCREEN_2- See Also:
-
WIZARD_SCREEN_3
public static final int WIZARD_SCREEN_3- See Also:
-
WIZARD_SCREEN_4
public static final int WIZARD_SCREEN_4- See Also:
-
WIZARD_SCREEN_5
public static final int WIZARD_SCREEN_5- See Also:
-
ERROR_CODE__MISSING_REQUIRED_PARAM
- See Also:
-
ERROR_CODE__S3_UPLOAD_FAILED
- See Also:
-
ERROR_CODE__UPLOAD_REQUEST_DECLINED
- See Also:
-
ERROR_CODE__TRANSACTION_ID_REQUIRED_TO_CREATE_XML_SUMMARY
- See Also:
-
HTTP_CONNECTION_TIMEOUT
public static final int HTTP_CONNECTION_TIMEOUT- See Also:
-
SOCKET_CONNECTION_TIMEOUT
public static final int SOCKET_CONNECTION_TIMEOUT- See Also:
-
MAX_CONNECTION_RETRIES
public static final int MAX_CONNECTION_RETRIES- See Also:
-
-
Constructor Details
-
Uploader
public Uploader()Constructor to run this application as an Applet. -
Uploader
public Uploader(JFrame ownerFrame, Properties standAloneArgumentProperties) throws S3ServiceException Constructor to run this application in a stand-alone window.- Parameters:
ownerFrame
- the frame the application will be displayed in- Throws:
S3ServiceException
-
-
Method Details
-
init
public void init()Prepares application to run as a GUI by finding/creating a root owner JFrame, and (if necessary) creating a directory for storing remembered logins. -
s3ServiceEventPerformed
Listener method that responds to events from the jets3t toolkit when objects are created in S3 - ie when files are uploaded.- Specified by:
s3ServiceEventPerformed
in interfaceS3ServiceEventListener
-
actionPerformed
Handles GUI actions.- Specified by:
actionPerformed
in interfaceActionListener
-
followHyperlink
Follows hyperlinks clicked on by a user. This is achieved differently depending on whether Cockpit is running as an applet or as a stand-alone application:- Application: Detects the default browser application for the user's system (using BareBonesBrowserLaunch) and opens the link as a new window in that browser
- Applet: Opens the link in the current browser using the applet's context
- Specified by:
followHyperlink
in interfaceHyperlinkActivatedListener
- Parameters:
url
- the url to opentarget
- the target pane to open the url in, eg "_blank". This may be null.
-
getCredentials
public org.apache.commons.httpclient.Credentials getCredentials(org.apache.commons.httpclient.auth.AuthScheme authscheme, String host, int port, boolean proxy) throws org.apache.commons.httpclient.auth.CredentialsNotAvailableException Implementation method for the CredentialsProvider interface.Based on sample code: InteractiveAuthenticationExample
- Specified by:
getCredentials
in interfaceorg.apache.commons.httpclient.auth.CredentialsProvider
- Throws:
org.apache.commons.httpclient.auth.CredentialsNotAvailableException
-
s3ServiceEventPerformed
- Specified by:
s3ServiceEventPerformed
in interfaceS3ServiceEventListener
-
s3ServiceEventPerformed
- Specified by:
s3ServiceEventPerformed
in interfaceS3ServiceEventListener
-
s3ServiceEventPerformed
- Specified by:
s3ServiceEventPerformed
in interfaceS3ServiceEventListener
-
s3ServiceEventPerformed
- Specified by:
s3ServiceEventPerformed
in interfaceS3ServiceEventListener
-
s3ServiceEventPerformed
- Specified by:
s3ServiceEventPerformed
in interfaceS3ServiceEventListener
-
s3ServiceEventPerformed
- Specified by:
s3ServiceEventPerformed
in interfaceS3ServiceEventListener
-
s3ServiceEventPerformed
- Specified by:
s3ServiceEventPerformed
in interfaceS3ServiceEventListener
-
s3ServiceEventPerformed
- Specified by:
s3ServiceEventPerformed
in interfaceS3ServiceEventListener
-
s3ServiceEventPerformed
- Specified by:
s3ServiceEventPerformed
in interfaceS3ServiceEventListener
-
s3ServiceEventPerformed
- Specified by:
s3ServiceEventPerformed
in interfaceS3ServiceEventListener
-
valueChanged
- Specified by:
valueChanged
in interfaceListSelectionListener
-
main
Run the Uploader as a stand-alone application.- Parameters:
args
-- Throws:
Exception
-