wt.clients.util.http
Class DownloadApplet

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended bywt.clients.util.http.DownloadApplet
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Runnable, Serializable

public class DownloadApplet
extends Applet
implements Runnable

Applet for downloading primary content from HTML user interface accessing the local file handling functionality from Java. This applet accepts several initialization parameters. All params are optional.

 <param	name="debug"	value="true|false"> 	retrieved from wt.clients.debug value in wt.properties
 <param	name="remember"	value="true|false"> 	is this an operation where the checksum and local download path should be remembered?
 <param	name="contentDelim"	value=";;;qqq">	retrieved from wt.doc.hiddenFieldDelimiter value in wt.properties
 <param	name="defaultPath"	value=""> 		retrieved from user preference wt/content/workspacePath
 <param	name="downloadQuantity"	value="3"> 	quantity of files to be downloaded
 <param	name="fileName"	value="file.txt"> 	for multiple files, concatenate with contentDelim value
 <param	name="downloadURL"	value=	URL that file will be downloaded from, for multiple files, concatenate with contentDelim value
 <param	name="downloadOpType"	value="ALWAYS_OPEN|ALWAYS_SAVE|ALWAYS_ASK"	retrieved from user preference wt/content/downloadOpType
 <param	name="url"             value="http:\\xxx">  url for next page to display after download
 <param	name="bgcolor"         value=decimal integer value of the desired background color, default is 14934992
 <param    name="wt.context.locale" value="XX">  locale tag for current browser language
This is a decimal integer giving the red, green, and blue components where the red component is in bits 16-23 of the argument, the green component is in bits 8-15 of the argument, and the blue component is in bits 0-7. The value zero indicates no contribution from the primary color component. Example: for the hex RGB color #E3E3CF, the bgcolor value would be "14934992". For #0000FF, bgcolor="255".


Supported API:true

Extendable:false

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.applet.Applet
Applet.AccessibleApplet
 
Nested classes inherited from class java.awt.Panel
Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  long checksum
           
private  boolean completed
           
private  ThreadGroup contextGroup
           
private static boolean DEBUG
           
private  String defaultPath
           
private  String DELIM
           
private  String downloadPath
           
private static Object initSync
           
private  boolean remember
           
private  Thread workerThread
           
 
Fields inherited from class java.applet.Applet
 
Fields inherited from class java.awt.Panel
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DownloadApplet()
           
 
Method Summary
 String createValidDefaultPath(String path)
           
 void destroy()
           
 int fileOperationTypeUnknown(int arraySize)
          Callback invoked when the operation type is unknown.
private  String getParameter(String paramName, String defaultParamValue)
           
 Applet getParentApplet()
           
 Frame getParentFrame()
           
private  URL getUrl()
           
 void init()
           
 void initiateDownload()
           
 boolean isDirectory(String path)
           
private static String[] parseIntoArray(String parseFrom, String delimiter, int arraySize)
           
 void run()
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, 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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, 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, isOpaque, 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, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

initSync

private static Object initSync

DEBUG

private static boolean DEBUG

contextGroup

private ThreadGroup contextGroup

workerThread

private Thread workerThread

checksum

private long checksum

downloadPath

private String downloadPath

remember

private boolean remember

completed

private boolean completed

DELIM

private String DELIM

defaultPath

private String defaultPath
Constructor Detail

DownloadApplet

public DownloadApplet()
Method Detail

init

public void init()

start

public void start()

stop

public void stop()

destroy

public void destroy()

run

public void run()
Specified by:
run in interface Runnable

initiateDownload

public void initiateDownload()

getParameter

private String getParameter(String paramName,
                            String defaultParamValue)

getUrl

private URL getUrl()

getParentApplet

public Applet getParentApplet()

getParentFrame

public Frame getParentFrame()

parseIntoArray

private static String[] parseIntoArray(String parseFrom,
                                       String delimiter,
                                       int arraySize)

createValidDefaultPath

public String createValidDefaultPath(String path)

isDirectory

public boolean isDirectory(String path)

fileOperationTypeUnknown

public int fileOperationTypeUnknown(int arraySize)
Callback invoked when the operation type is unknown. Valid file operation types are HTTPUploadDownload.FILE_OPERATION_TYPE_TRANSFER and HTTPUploadDownload.FILE_OPERATION_TYPE_OPEN.