Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.share.util
Interface MultipartFormItem


public interface MultipartFormItem

MultipartFormItem - Represent an item from a form file-post. An item can be either a parameter or a file. If it is a parameter, use getName() and getValue() to get the name and value of the parameter. If it is a file, then use getFilename and writeFile to find the filename and then write the contents to an OutputStream.


Method Summary
 java.lang.String getContentType()
          Returns the MIME content type of the file.
 java.lang.String getFilename()
          Returns the filename of this item, or null if this is a parameter and not a file
 java.io.InputStream getInputStream()
          Returns an InputStream that can be used to read the file.
 java.lang.String getName()
          Returns the input-field name of this item in the form.
 java.lang.String getValue()
          Returns the value of the parameter, or null if this is a file and not a parameter.
 long writeFile(java.io.OutputStream stream)
          Writes the file to the given output stream.
 

Method Detail

getValue

public java.lang.String getValue()
Returns the value of the parameter, or null if this is a file and not a parameter.

getName

public java.lang.String getName()
Returns the input-field name of this item in the form.

getFilename

public java.lang.String getFilename()
Returns the filename of this item, or null if this is a parameter and not a file

getContentType

public java.lang.String getContentType()
Returns the MIME content type of the file.

writeFile

public long writeFile(java.io.OutputStream stream)
               throws java.io.IOException
Writes the file to the given output stream. Clients can call this method or getInputStream(), but not both.

Parameters:
stream - the output stream to write to.
Returns:
The total number of bytes written
Throws:
java.io.EOFException - if the length of this item exceeds the maximum length set on the MultipartFormHandler
See Also:
getInputStream(), MultipartFormHandler.setMaximumAllowedBytes(long)

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns an InputStream that can be used to read the file. Clients may call this method or writeFile(), but not both.
See Also:
writeFile(java.io.OutputStream)

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.