org.apache.shindig.protocol.multipart
Interface FormDataItem


public interface FormDataItem

Interface to represent an field item in multipart/form-data.


Method Summary
 byte[] get()
          Returns the content of the field item.
 String getAsString()
          Returns the content of the field item as text.
 String getContentType()
          Returns the Content type of the field item.
 String getFieldName()
          Field name of this field item.
 InputStream getInputStream()
          Returns an InputStream from which the content of the field item can be read.
 String getName()
          Name of the uploaded file, if the item represents file upload.
 long getSize()
          The size of the content stored in this field item.
 boolean isFormField()
          Used to identify if the field item represents a file upload or a regular form field.
 

Method Detail

getContentType

String getContentType()
Returns the Content type of the field item.

Returns:
content type

getSize

long getSize()
The size of the content stored in this field item.

Returns:
size of the content

getInputStream

InputStream getInputStream()
                           throws IOException
Returns an InputStream from which the content of the field item can be read.

Returns:
InputStream to the content of the field item.
Throws:
IOException

get

byte[] get()
Returns the content of the field item.

Returns:
content of the field item

getAsString

String getAsString()
Returns the content of the field item as text.

Returns:
content of the field item as text

getName

String getName()
Name of the uploaded file, if the item represents file upload. This will be only valid when isFormField() returns false.

Returns:
name of the uploaded file

getFieldName

String getFieldName()
Field name of this field item. Can be used to identify a field by name but as per RFC this need not be unique.

Returns:
name of the field

isFormField

boolean isFormField()
Used to identify if the field item represents a file upload or a regular form field.

Returns:
true if it is a regular form field


Copyright © 2007-2012. All Rights Reserved.