org.loom.servlet.params
Class InMemoryFileParameter

java.lang.Object
  extended by org.loom.servlet.params.InMemoryFileParameter
All Implemented Interfaces:
FileParameter

public class InMemoryFileParameter
extends java.lang.Object
implements FileParameter

Uploaded file managed in memory


Constructor Summary
InMemoryFileParameter(org.apache.commons.fileupload.FileItemStream item)
           
 
Method Summary
 byte[] getBytes()
          Get the file contents as a byte array
 java.lang.String getContentType()
          Get the file content-type.
 java.lang.String getFilename()
          Get the uploaded filename.
 long getFileSize()
          Get the file size, -1 if unknown
 java.io.InputStream getStream()
          Get the file contents as an input stream.
 void setContentType(java.lang.String contentType)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InMemoryFileParameter

public InMemoryFileParameter(org.apache.commons.fileupload.FileItemStream item)
Method Detail

getBytes

public byte[] getBytes()
Description copied from interface: FileParameter
Get the file contents as a byte array

Specified by:
getBytes in interface FileParameter

getStream

public java.io.InputStream getStream()
                              throws java.io.IOException
Description copied from interface: FileParameter
Get the file contents as an input stream.

Specified by:
getStream in interface FileParameter
Throws:
java.io.IOException

getContentType

public java.lang.String getContentType()
Description copied from interface: FileParameter
Get the file content-type. If the browser does not provide one, it will be guessed using MimeUtils.

Specified by:
getContentType in interface FileParameter

setContentType

public void setContentType(java.lang.String contentType)

getFileSize

public long getFileSize()
Description copied from interface: FileParameter
Get the file size, -1 if unknown

Specified by:
getFileSize in interface FileParameter

getFilename

public java.lang.String getFilename()
Description copied from interface: FileParameter
Get the uploaded filename. The file path, if provided by the browser, will be removed

Specified by:
getFilename in interface FileParameter

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object