planetj.dataengine.fileupload
Class FileUploader

java.lang.Object
  |
  +--planetj.dataengine.fileupload.FileUploader
All Implemented Interfaces:
FileUploaderIfc

public class FileUploader
extends Object
implements FileUploaderIfc

This component when rendered on a page allows users to upload a file to the server. Users are given a text field in which they can enter the name of the file to upload, and a browse button which shows a dialog box which can be used to search for a file on their system to upload. The following characteristics of a file upload are controlled by the browser and are not configurable:

To obtain a file that has been uploaded by a user using this component, invoke the FileUploadHelper.getFile() method.

Author:
Justin Epstein, PlanetJ Corp.

Constructor Summary
FileUploader()
           
 
Method Summary
static String generateKey(String name)
          Generates a key, based on the name of a FileUploader object.
 String getKey()
          Gets a key which should be unique for this object.
 int getSize()
          Gets the size of the text field in which the name of the file to upload can be entered/seen.
 void setSize(int newSize)
          Sets the size of the text field in which the name of the file to upload can be entered/seen.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUploader

public FileUploader()
Method Detail

generateKey

public static String generateKey(String name)
Generates a key, based on the name of a FileUploader object. It is assumed that the key will be unique in the scope of an HttpRequest. It is used to store and retrieve an UploadedFile object which represents the file uploaded by a FileUploader.

Parameters:
name - The name of a FileUploader component (no two FileUpload components on the same page should have the same name).
Returns:
A key, which should be unique, for the FileUploader component.

getKey

public String getKey()
Gets a key which should be unique for this object. It is used to store and retrieve the UploadedFile object which corresponds to a file uploaded by this object.

Specified by:
getKey in interface FileUploaderIfc

getSize

public int getSize()
Gets the size of the text field in which the name of the file to upload can be entered/seen.

Specified by:
getSize in interface FileUploaderIfc
Returns:
The number of characters long that the text field will be.

setSize

public void setSize(int newSize)
Sets the size of the text field in which the name of the file to upload can be entered/seen.

Specified by:
setSize in interface FileUploaderIfc
Parameters:
newSize - The number of characters long that the text field will be.