站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

MultiPartHandler (UI Handler Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.lib.uihandler 1.10

org.netbeans.lib.uihandler
Class MultiPartHandler

java.lang.Object
  extended by org.netbeans.lib.uihandler.MultiPartHandler

public class MultiPartHandler
extends Object


Nested Class Summary
static interface MultiPartHandler.InputFacade
           
static interface MultiPartHandler.RequestFacade
           
 
Field Summary
protected  Hashtable<String,Vector<String>> formFields
           
protected  Hashtable<String,org.netbeans.lib.uihandler.MultiPartHandler.OneUpload> uploadFiles
           
 
Constructor Summary
MultiPartHandler(MultiPartHandler.RequestFacade request, String tmpDirectory)
          Instantiate a new multipart handler with default
MultiPartHandler(MultiPartHandler.RequestFacade request, String tmpDirectory, int maxUploadSize)
           
MultiPartHandler(MultiPartHandler.RequestFacade request, String tmpDirectory, int maxUploadSize, String fieldEncoding)
          Instantiate a new OneUpload to handle the given request, saving any uploaded files to the given directory and limiting the upload size to maxUploadSize.
 
Method Summary
 void close()
          close the multi-part form handler
 File getFile(String name)
          Returns a File object for the specified file saved on the server's filesystem, or null if the file was not included in the upload.
 String getFileName(String name)
          Returns the filesystem name of the specified file, or null if the file was not included in the upload.
 Enumeration getFileNames()
          Returns the names of all the uploaded files as an Enumeration of Strings.
 String getFileType(String name)
          Returns the content type of the specified file (as supplied by the client browser), or null if the file was not included in the upload.
 String getParameter(String name)
          Returns the value of the named parameter as a String, or null if the parameter was not sent or was sent without a value.
 Enumeration getParameterNames()
          Returns the names of all the parameters as an Enumeration of Strings.
 String[] getParameterValues(String name)
          Returns the values of the named parameter as a String array, or null if the parameter was not sent.
 void parseMultipartUpload()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

formFields

protected Hashtable<String,Vector<String>> formFields

uploadFiles

protected Hashtable<String,org.netbeans.lib.uihandler.MultiPartHandler.OneUpload> uploadFiles
Constructor Detail

MultiPartHandler

public MultiPartHandler(MultiPartHandler.RequestFacade request,
                        String tmpDirectory)
                 throws IOException
Instantiate a new multipart handler with default

Throws:
IOException

MultiPartHandler

public MultiPartHandler(MultiPartHandler.RequestFacade request,
                        String tmpDirectory,
                        int maxUploadSize)
                 throws IOException
Throws:
IOException

MultiPartHandler

public MultiPartHandler(MultiPartHandler.RequestFacade request,
                        String tmpDirectory,
                        int maxUploadSize,
                        String fieldEncoding)
                 throws IOException
Instantiate a new OneUpload to handle the given request, saving any uploaded files to the given directory and limiting the upload size to maxUploadSize. An IOException is thrown when the request content-type doesn't match with multipart/form-data or if the upload size exceeds the given limit. call parseMultipartUpload() to parse various parts of the posted data and then call getParameter(), getParameters(), getParameterNames() and getParameterValues() functions to access form field names and their values. call getFile(), getFileType() to access uploaded file and its content-type.

Throws:
IOException
Method Detail

parseMultipartUpload

public void parseMultipartUpload()
                          throws IOException
Throws:
IOException

getParameterNames

public Enumeration getParameterNames()
Returns the names of all the parameters as an Enumeration of Strings. It returns an empty Enumeration if there are no parameters.


getFileNames

public Enumeration getFileNames()
Returns the names of all the uploaded files as an Enumeration of Strings. It returns an empty Enumeration if there are no uploaded files. Each file name is the name specified by the form, not by the user.


getParameter

public String getParameter(String name)
Returns the value of the named parameter as a String, or null if the parameter was not sent or was sent without a value. The value is guaranteed to be in its normal, decoded form. If the parameter has multiple values, only the last one is returned (for backward compatibility). For parameters with multiple values, it's possible the last "value" may be null.


getParameterValues

public String[] getParameterValues(String name)
Returns the values of the named parameter as a String array, or null if the parameter was not sent. The array has one entry for each parameter field sent. If any field was sent without a value that entry is stored in the array as a null. The values are guaranteed to be in their normal, decoded form. A single value is returned as a one-element array.


getFileName

public String getFileName(String name)
Returns the filesystem name of the specified file, or null if the file was not included in the upload. A filesystem name is the name specified by the user. It is also the name under which the file is actually saved.


getFileType

public String getFileType(String name)
Returns the content type of the specified file (as supplied by the client browser), or null if the file was not included in the upload.


getFile

public File getFile(String name)
Returns a File object for the specified file saved on the server's filesystem, or null if the file was not included in the upload.


close

public void close()
           throws IOException
close the multi-part form handler

Throws:
IOException

org.netbeans.lib.uihandler 1.10

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.