org.melati.servlet
Class MemoryFormDataAdaptor

Package class diagram package MemoryFormDataAdaptor
java.lang.Object
  extended by org.melati.servlet.MemoryFormDataAdaptor
All Implemented Interfaces:
FormDataAdaptor

public class MemoryFormDataAdaptor
extends Object
implements FormDataAdaptor

Store the uploaded data in a byte array in memory.


Field Summary
protected  int BUFSIZE
          Size for byte buffers
 
Constructor Summary
MemoryFormDataAdaptor()
           
 
Method Summary
 byte[] getData()
          Return the data as a byte array.
 File getFile()
          Return a File object pointing to the saved data (if one exists).
 long getSize()
          Return the size of the data.
 String getURL()
          Return a url to the object.
 void readData(MultipartFormField field, DelimitedBufferedInputStream in, byte[] delim)
          Read data from in until the delim and save it in an internal buffer for later use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFSIZE

protected int BUFSIZE
Size for byte buffers

Constructor Detail

MemoryFormDataAdaptor

public MemoryFormDataAdaptor()
Method Detail

getData

public byte[] getData()
Return the data as a byte array.

Specified by:
getData in interface FormDataAdaptor
Returns:
the data as a byte array

getSize

public long getSize()
Return the size of the data.

Specified by:
getSize in interface FormDataAdaptor
Returns:
the size of the data

getFile

public File getFile()
Return a File object pointing to the saved data (if one exists).

Specified by:
getFile in interface FormDataAdaptor
Returns:
always null

getURL

public String getURL()
Return a url to the object.

Specified by:
getURL in interface FormDataAdaptor
Returns:
always null

readData

public void readData(MultipartFormField field,
                     DelimitedBufferedInputStream in,
                     byte[] delim)
              throws IOException
Read data from in until the delim and save it in an internal buffer for later use.

Specified by:
readData in interface FormDataAdaptor
Parameters:
field - a MultipartFormField to be read
in - a DelimitedBufferedInputStream to read from
delim - the delimitor to differentiate elements
Throws:
IOException - if there is a problem reading the input


Copyright © 2000-2010 PanEris. All Rights Reserved.