wjhk.jupload2.context
Class JUploadContextApplet

java.lang.Object
  extended by wjhk.jupload2.context.DefaultJUploadContext
      extended by wjhk.jupload2.context.JUploadContextApplet
All Implemented Interfaces:
JUploadContext

public class JUploadContextApplet
extends DefaultJUploadContext

Implementation of the Jupload Context, for an applet. One such context is created at run time.

Version:
$Revision: 750 $
Author:
etienne_sf
See Also:
DefaultJUploadContext

Field Summary
private  javax.swing.JApplet theApplet
          The current applet.
 
Fields inherited from class wjhk.jupload2.context.DefaultJUploadContext
uploadPolicy
 
Constructor Summary
JUploadContextApplet(javax.swing.JApplet theApplet)
          The default constructor.
 
Method Summary
 void displayURL(java.lang.String url, boolean success)
          Just throws a UnsupportedOperationException exception.
 javax.swing.JApplet getApplet()
          Just throws a UnsupportedOperationException exception.
 java.awt.Cursor getCursor()
          Just throws a UnsupportedOperationException exception.
 boolean getParameter(java.lang.String key, boolean def)
          Just throws a UnsupportedOperationException exception.
 float getParameter(java.lang.String key, float def)
          Just throws a UnsupportedOperationException exception.
 int getParameter(java.lang.String key, int def)
          Just throws a UnsupportedOperationException exception.
 long getParameter(java.lang.String key, long def)
          Just throws a UnsupportedOperationException exception.
 java.lang.String getParameter(java.lang.String key, java.lang.String def)
          Just throws a UnsupportedOperationException exception.
 java.lang.String jsString(java.lang.String s)
          Generate a js String, that can be written in a javascript expression.
 java.lang.String normalizeURL(java.lang.String url)
          Generates a valid URL, from a String.
 void readCookieFromNavigator(java.util.Vector<java.lang.String> headers)
          Loads cookies, and add them to the specific headers for upload requests.
 void readUserAgentFromNavigator(java.util.Vector<java.lang.String> headers)
          Loads userAgent, and add it as a header to the specific headers for upload requests.
 java.awt.Cursor setCursor(java.awt.Cursor cursor)
          Just throws a UnsupportedOperationException exception.
 void showStatus(java.lang.String status)
          Just throws a UnsupportedOperationException exception.
 
Methods inherited from class wjhk.jupload2.context.DefaultJUploadContext
displayDebug, displayDebugParameterValue, displayErr, displayInfo, displayWarn, getBuildDate, getBuildNumber, getLastModified, getLogWindow, getMimeType, getSvnProperties, getUploadPanel, getUploadPolicy, getVersion, init, main, parseBoolean, parseFloat, parseInt, parseLong, registerUnload, runUnload, setProperty, setWaitCursor, startUpload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

theApplet

private javax.swing.JApplet theApplet
The current applet. All applet parameters are reading by using this attribute.

Constructor Detail

JUploadContextApplet

public JUploadContextApplet(javax.swing.JApplet theApplet)
The default constructor.

Parameters:
theApplet - The applet is mandatory, to read the applet parameters.
Method Detail

getApplet

public javax.swing.JApplet getApplet()
Just throws a UnsupportedOperationException exception.

Specified by:
getApplet in interface JUploadContext
Overrides:
getApplet in class DefaultJUploadContext
Returns:
Not used

getParameter

public java.lang.String getParameter(java.lang.String key,
                                     java.lang.String def)
Just throws a UnsupportedOperationException exception.

Specified by:
getParameter in interface JUploadContext
Overrides:
getParameter in class DefaultJUploadContext
Parameters:
key - The name of the parameter to fetch.
def - A default value which is used, when the specified parameter is not set.
Returns:
Not used

getParameter

public int getParameter(java.lang.String key,
                        int def)
Just throws a UnsupportedOperationException exception.

Specified by:
getParameter in interface JUploadContext
Overrides:
getParameter in class DefaultJUploadContext
Parameters:
key - The parameter name
def - The default value
Returns:
Not used

getParameter

public float getParameter(java.lang.String key,
                          float def)
Just throws a UnsupportedOperationException exception.

Specified by:
getParameter in interface JUploadContext
Overrides:
getParameter in class DefaultJUploadContext
Parameters:
key - The parameter name
def - The default value
Returns:
Not used

getParameter

public long getParameter(java.lang.String key,
                         long def)
Just throws a UnsupportedOperationException exception.

Specified by:
getParameter in interface JUploadContext
Overrides:
getParameter in class DefaultJUploadContext
Parameters:
key - The parameter name
def - The default value
Returns:
Not used

getParameter

public boolean getParameter(java.lang.String key,
                            boolean def)
Just throws a UnsupportedOperationException exception.

Specified by:
getParameter in interface JUploadContext
Overrides:
getParameter in class DefaultJUploadContext
Parameters:
key - The parameter name
def - The default value
Returns:
Not used

readCookieFromNavigator

public void readCookieFromNavigator(java.util.Vector<java.lang.String> headers)
Loads cookies, and add them to the specific headers for upload requests. Just throws a UnsupportedOperationException exception.

Specified by:
readCookieFromNavigator in interface JUploadContext
Overrides:
readCookieFromNavigator in class DefaultJUploadContext
Parameters:
headers - The headers, coming from DefaultUploadPolicy

readUserAgentFromNavigator

public void readUserAgentFromNavigator(java.util.Vector<java.lang.String> headers)
Loads userAgent, and add it as a header to the specific headers for upload requests. Just throws a UnsupportedOperationException exception.

Specified by:
readUserAgentFromNavigator in interface JUploadContext
Overrides:
readUserAgentFromNavigator in class DefaultJUploadContext
Parameters:
headers - The headers, coming from DefaultUploadPolicy

getCursor

public java.awt.Cursor getCursor()
Description copied from class: DefaultJUploadContext
Just throws a UnsupportedOperationException exception.

Specified by:
getCursor in interface JUploadContext
Overrides:
getCursor in class DefaultJUploadContext
Returns:
The current cursor
See Also:
JUploadContext.setCursor(Cursor)

setCursor

public java.awt.Cursor setCursor(java.awt.Cursor cursor)
Description copied from class: DefaultJUploadContext
Just throws a UnsupportedOperationException exception.

Specified by:
setCursor in interface JUploadContext
Overrides:
setCursor in class DefaultJUploadContext
Parameters:
cursor - The cursor to set
Returns:
Not used
See Also:
JUploadContext.setCursor(Cursor)

showStatus

public void showStatus(java.lang.String status)
Just throws a UnsupportedOperationException exception.

Specified by:
showStatus in interface JUploadContext
Overrides:
showStatus in class DefaultJUploadContext

displayURL

public void displayURL(java.lang.String url,
                       boolean success)
Description copied from class: DefaultJUploadContext
Just throws a UnsupportedOperationException exception.

Specified by:
displayURL in interface JUploadContext
Overrides:
displayURL in class DefaultJUploadContext
Parameters:
url - The URL to display, in text format. It will be normalized 'before use'.
success - Indicates whether the upload was a success or not.
See Also:
JUploadContext.displayURL(String, boolean)

normalizeURL

public java.lang.String normalizeURL(java.lang.String url)
                              throws JUploadException
Generates a valid URL, from a String. The generation may add the documentBase of the applet.

Specified by:
normalizeURL in interface JUploadContext
Overrides:
normalizeURL in class DefaultJUploadContext
Parameters:
url - A url. Can be a path relative to the current one.
Returns:
The normalized URL
Throws:
JUploadException

jsString

public java.lang.String jsString(java.lang.String s)
Generate a js String, that can be written in a javascript expression. It's up to the caller to put the starting and ending quotes. The double quotes are replaced by simple quotes (to let simple quotes unchanged, as it may be used in common language). Thus, start and end of JS string should be with double quotes, when using the return of this function.

Parameters:
s -
Returns:
The transformed string, that can be written in the output, into a javascript string. It doesn't contain the starting and ending double quotes.