|
SAP J2EE Engine Version 6.40 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.sap.engine.services.servlets_jsp.lib.multipart.MultipartMessage
This class represents a multipart message body. An http message is multipart if it has content-type starting with "multipart/". A multipart message consists of multipart sub-messages. This class is actually a set of all sub-messages of a multipart message. It contains methods for getting the sub-messages count, obtaining a single message by name or index, adding and removing multipart sub-messages. A multipart request body can be obtained as instance of this class using the getAttribute(String s) method of HttpServletRequest interface. The default parameter that must be passed to this method is MULTIPART_BODY_KEY.
| Field Summary | |
protected boolean |
addFormParameters
|
protected java.lang.String |
contentType
|
static java.lang.String |
FORM_DATA_TYPE
|
static java.lang.String |
MULTIPART_BODY_KEY
The default key used for accessing a multipart request / response body through servlet API. |
| Constructor Summary | |
MultipartMessage()
|
|
| Method Summary | |
void |
addBodyPart(MultipartPart bodypart)
Adds a sub-message to this multipart message. |
void |
addBodyPart(MultipartPart bodypart,
int i)
Adds a sub-message in this multipart message on a specified possition. |
abstract void |
addFormParametersToRequest()
|
MultipartPart |
getBodyPart(int i)
Returns a sub-message at a specified possition within this multipart message. |
MultipartPart |
getBodyPart(java.lang.String s)
Returns a sub-message with a specified name. |
java.util.Enumeration |
getBodyParts()
Returns an enumeration of all sub-messages within this multipart message. |
java.lang.String |
getContentType()
Returns the content type of this multipart body. |
int |
getCount()
Returns the number of the sub-messages within this multipart message. |
boolean |
isFormParametersToRequest()
|
protected abstract void |
parse()
|
void |
removeBodyPart(int i)
Removes a sub-message on a specified possition from this multipart message. |
boolean |
removeBodyPart(MultipartPart bodypart)
Removes a sub-message from this multipart message. |
abstract void |
writeTo(java.io.OutputStream outputstream)
Writes this multipart message to the specified output stream according to the multipart messages syntax. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String MULTIPART_BODY_KEY
public static final java.lang.String FORM_DATA_TYPE
protected java.lang.String contentType
protected boolean addFormParameters
| Constructor Detail |
public MultipartMessage()
| Method Detail |
public java.lang.String getContentType()
throws java.io.IOException,
MultipartParseException
java.io.IOException - If some error occurs in reading / writing to the input stream of the message bodyMultipartParseException - If the message body doesn't represent a valid multipart message
public int getCount()
throws java.io.IOException,
MultipartParseException
java.io.IOException - If some error occurs in reading / writing to the input stream of the message bodyMultipartParseException - If the message body doesn't represent a valid multipart message
public java.util.Enumeration getBodyParts()
throws java.io.IOException,
MultipartParseException
java.io.IOException - If some error occurs in reading / writing to the input stream of the message bodyMultipartParseException - If the message body doesn't represent a valid multipart message
public MultipartPart getBodyPart(int i)
throws java.io.IOException,
MultipartParseException
i - The possition of the sub-message that will be returned or null if a sub-message with such index does not existjava.io.IOException - If some error occurs in reading / writing to the input stream of the message bodyMultipartParseException - If the message body doesn't represent a valid multipart messageArrayIndexOutOfBoundsException - if the i is a negative number or number that exceeds the number of sub-messages
public boolean removeBodyPart(MultipartPart bodypart)
throws java.io.IOException,
MultipartParseException
bodypart - The sub-message that will be removedjava.io.IOException - If some error occurs in reading / writing to the input stream of the message bodyMultipartParseException - If the message body doesn't represent a valid multipart message
public void removeBodyPart(int i)
throws java.io.IOException,
MultipartParseException
i - The index of the sub-message that will be removedjava.io.IOException - If some error occurs in reading / writing to the input stream of the message bodyMultipartParseException - If the message body doesn't represent a valid multipart messageArrayIndexOutOfBoundsException - if the index is either negative number of exceeds the number of sub-messages within this multipart message.
public void addBodyPart(MultipartPart bodypart)
throws java.io.IOException,
MultipartParseException
bodypart - The sub-message that will be addedjava.io.IOException - If some error occurs in reading / writing to the input stream of the message bodyMultipartParseException - If the message body doesn't represent a valid multipart message
public void addBodyPart(MultipartPart bodypart,
int i)
throws java.io.IOException,
MultipartParseException
bodypart - The sub-message that will be addedi - The index, identifying the position on which the sub-message will be added. The first message has index 0.java.io.IOException - If some error occurs in reading / writing to the input stream of the message bodyMultipartParseException - If the message body doesn't represent a valid multipart messageArrayIndexOutOfBoundsException - if the index is either negative number of exceeds the number of sub-messages within this multipart message.
public MultipartPart getBodyPart(java.lang.String s)
throws java.io.IOException,
MultipartParseException
s - The name of the sub-message that will be returnedjava.io.IOException - If some error occurs in reading / writing to the input stream of the message bodyMultipartParseException - If the message body doesn't represent a valid multipart messagepublic abstract void addFormParametersToRequest()
public boolean isFormParametersToRequest()
public abstract void writeTo(java.io.OutputStream outputstream)
throws java.io.IOException
outputstream - The output stream where the message will be written tojava.io.IOException - If some error occurs in reading / writing to the input stream of the message body
protected abstract void parse()
throws java.io.IOException,
MultipartParseException
|
SAP J2EE Engine Version 6.40 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||