de.mguennewig.pobjform.html
Class MultipartRequest.File

java.lang.Object
  extended by de.mguennewig.pobjform.html.MultipartRequest.File
Enclosing class:
MultipartRequest

public static final class MultipartRequest.File
extends java.lang.Object

The class MultipartRequest.File encapsulates uploaded files.

Objects of this class are the values of file parameters. This implementation saves the data as temporary files in the directory specified by the system property java.io.tmpdir.


Method Summary
 java.io.InputStream getInputStream()
          Gets an input stream to read the contents of this object.
 long getLength()
          Gets the length of this file.
 java.lang.String getName()
          Gets the original file name, as sent by the request.
 java.lang.String getType()
          Gets the MIME type of the file, as sent by the client.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Gets an input stream to read the contents of this object.

The input stream returned by a previous call to getInputStream(), if any, is automatically closed.

Returns:
an input stream to read this object's contents
Throws:
java.io.IOException - if an error occurs while opening the input stream

getLength

public long getLength()
Gets the length of this file.

Returns:
The length of this file

getName

public java.lang.String getName()
Gets the original file name, as sent by the request.

Notice that the file name depends on the client's platform.

Returns:
The original file name

getType

public java.lang.String getType()
Gets the MIME type of the file, as sent by the client.

Notice that, since MIME types are case insensitive, the type is always returned in lower case.

Returns:
the MIME type of the file or an empty string if the type is not known