com.ibm.portal.resolver.streams
Class FormDataInputStream.Entry

java.lang.Object
  extended by java.io.InputStream
      extended by com.ibm.portal.resolver.streams.MultipartInputStream.Entry
          extended by com.ibm.portal.resolver.streams.FormDataInputStream.Entry
All Implemented Interfaces:
IterableListModel<java.util.Map.Entry<java.lang.String,java.lang.String>>, ListModel<java.util.Map.Entry<java.lang.String,java.lang.String>>, MetaData<java.lang.String,java.util.Map.Entry<java.lang.String,java.lang.String>>, MultipartStream.Entry, java.io.Closeable, java.lang.Iterable<java.util.Map.Entry<java.lang.String,java.lang.String>>, java.nio.channels.Channel
Enclosing class:
FormDataInputStream

public abstract static class FormDataInputStream.Entry
extends MultipartInputStream.Entry

Extension of the MultipartInputStream.Entry that adds information about the parameter name and characterset. All methods that access the content of the entry apply to this entry only, i.e. do not span neither headers nor the boundary. The FormDataInputStream.Entry stream can be closed without closing the outer FormDataInputStream.


Constructor Summary
FormDataInputStream.Entry()
           
 
Method Summary
abstract  java.nio.charset.Charset getCharset()
          Returns the characterset used to decode the value.
abstract  javax.mail.internet.ContentDisposition getContentDisposition()
          The decoded content disposition, will always be available, because otherwise the mime entry would not habe been recognized as a valid multipart/form-data entry.
abstract  java.lang.String getName()
          The name of the entry field, will always be available for a valid multipart/form-data entry.
abstract  java.lang.String getNonce()
          Returns the nonce for the input stream.
abstract  int read(java.io.Writer dst)
          Deprecated. use write(Writer) instead due to more consistent naming
abstract  java.lang.String readString()
          Reads the value of the field as a string
abstract  void write(java.io.Writer dst)
          Copies the content of the entry in the current characterset to the output writer
 
Methods inherited from class com.ibm.portal.resolver.streams.MultipartInputStream.Entry
close, write
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.portal.resolver.streams.MultipartStream.Entry
getContentType, getNames, iterator
 
Methods inherited from interface com.ibm.portal.MetaData
getValue
 
Methods inherited from interface java.nio.channels.Channel
isOpen
 

Constructor Detail

FormDataInputStream.Entry

public FormDataInputStream.Entry()
Method Detail

getCharset

public abstract java.nio.charset.Charset getCharset()
Returns the characterset used to decode the value. Either this characterset has been decoded from the FormDataStream.KEY_CHARSET parameter or it will default to UTF8.

Returns:
the character set, not null

getContentDisposition

public abstract javax.mail.internet.ContentDisposition getContentDisposition()
The decoded content disposition, will always be available, because otherwise the mime entry would not habe been recognized as a valid multipart/form-data entry.

Returns:
content disposition of this entry, never null

getName

public abstract java.lang.String getName()
The name of the entry field, will always be available for a valid multipart/form-data entry.

Returns:
the name of the field, not null

getNonce

public abstract java.lang.String getNonce()
Returns the nonce for the input stream. Either this token gets decoded from the FormDataStream.KEY_CSRF_TOKEN parameter or it will be null. A special case exists if the stream was constructed on top of an ActionRequest. Since such a request is already protected against CSRF attacks, this method will return the default nonce for the current user even in case the stream does not include the FormDataStream.KEY_CSRF_TOKEN parameter.

Returns:
the nonce or null if the stream does not contain a nonce
Since:
8.5

read

@Deprecated
public abstract int read(java.io.Writer dst)
                  throws java.io.IOException
Deprecated. use write(Writer) instead due to more consistent naming

Reads the value of the field in the current characterset and copies it into the target writer.

Parameters:
dst - target writer, not null
Returns:
the number of characters actually copied
Throws:
java.io.IOException - - if the data could not be read or copied
Since:
6.1.0.3

readString

public abstract java.lang.String readString()
                                     throws java.io.IOException
Reads the value of the field as a string

Returns:
the value as a string
Throws:
java.io.IOException - if an I/O error has occurred
Since:
6.1.0.3

write

public abstract void write(java.io.Writer dst)
                    throws java.io.IOException
Copies the content of the entry in the current characterset to the output writer

Parameters:
dst - target writer, not null
Throws:
java.io.IOException - - if the data could not be read or copied
Since:
8.0