|
SAP NetWeaver 7.20 (SP01) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sap.engine.services.servlets_jsp.lib.multipart.MultipartMessage
public abstract class 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 String |
charset
|
protected String |
contentType
|
static String |
FORM_DATA_TYPE
The content type used for submitting forms that contain files, non-ASCII data, and binary data in series of parts. |
static String |
MULTIPART_BODY_KEY
The default key used for accessing a multipart request / response body through servlet API. |
protected Vector |
parts
|
| 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 position. |
abstract void |
addFormParametersToRequest()
Adds the data sent with "multipart/form-data" type of request in the parameters set of the request. |
MultipartPart |
getBodyPart(int i)
Returns a sub-message at a specified position within this multipart message. |
MultipartPart |
getBodyPart(String s)
Returns a sub-message with a specified name. |
Enumeration |
getBodyParts()
Returns an enumeration of all sub-messages within this multipart message. |
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()
Indicates whether the data sent with "multipart/form-data" type of request is available as request parameters. |
protected abstract void |
parse()
Parses the multipart massage in smaller sub-messages. |
void |
removeBodyPart(int i)
Removes a sub-message on a specified position from this multipart message. |
boolean |
removeBodyPart(MultipartPart bodypart)
Removes a sub-message from this multipart message. |
void |
setCharset(String charset)
Sets encoding for part's headers parsing. |
abstract void |
writeTo(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 String MULTIPART_BODY_KEY
public static final String FORM_DATA_TYPE
protected Vector parts
protected String contentType
protected boolean addFormParameters
protected String charset
| Constructor Detail |
|---|
public MultipartMessage()
| Method Detail |
|---|
public String getContentType()
throws IOException,
MultipartParseException
IOException - If some error occurs in reading / writing to the input stream of the message body
MultipartParseException - If the message body doesn't represent a valid multipart message
public int getCount()
throws IOException,
MultipartParseException
IOException - If some error occurs in reading / writing to the input stream of the message body
MultipartParseException - If the message body doesn't represent a valid multipart message
public Enumeration getBodyParts()
throws IOException,
MultipartParseException
IOException - If some error occurs in reading / writing to the input stream of the message body
MultipartParseException - If the message body doesn't represent a valid multipart message
public MultipartPart getBodyPart(int i)
throws IOException,
MultipartParseException
i - The position of the sub-message that will be returned or null if a sub-message with such index does not exist
IOException - If some error occurs in reading / writing to the input stream of the message body
MultipartParseException - If the message body doesn't represent a valid multipart message
ArrayIndexOutOfBoundsException - if the i is a negative number or number that exceeds the number of sub-messages
public boolean removeBodyPart(MultipartPart bodypart)
throws IOException,
MultipartParseException
bodypart - The sub-message that will be removed
IOException - If some error occurs in reading / writing to the input stream of the message body
MultipartParseException - If the message body doesn't represent a valid multipart message
public void removeBodyPart(int i)
throws IOException,
MultipartParseException
i - The index of the sub-message that will be removed
IOException - If some error occurs in reading / writing to the input stream of the message body
MultipartParseException - If the message body doesn't represent a valid multipart message
ArrayIndexOutOfBoundsException - if the index is either negative number of exceeds the number of sub-messages within this multipart message.
public void addBodyPart(MultipartPart bodypart)
throws IOException,
MultipartParseException
bodypart - The sub-message that will be added
IOException - If some error occurs in reading / writing to the input stream of the message body
MultipartParseException - If the message body doesn't represent a valid multipart message
public void addBodyPart(MultipartPart bodypart,
int i)
throws 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.
IOException - If some error occurs in reading / writing to the input stream of the message body
MultipartParseException - If the message body doesn't represent a valid multipart message
ArrayIndexOutOfBoundsException - if the index is either negative number of exceeds the number of sub-messages within this multipart message.
public MultipartPart getBodyPart(String s)
throws IOException,
MultipartParseException
s - The name of the sub-message that will be returned
IOException - If some error occurs in reading / writing to the input stream of the message body
MultipartParseException - If the message body doesn't represent a valid multipart messagepublic abstract void addFormParametersToRequest()
public boolean isFormParametersToRequest()
public abstract void writeTo(OutputStream outputstream)
throws IOException
outputstream - The output stream where the message will be written to
IOException - If some error occurs in reading / writing to the input stream of the message body
protected abstract void parse()
throws IOException,
MultipartParseException
IOException - If some error occurs in reading / writing to the input stream of the message body
MultipartParseException - If the message body doesn't represent a valid multipart message
public void setCharset(String charset)
throws UnsupportedEncodingException
charset - The encoding to be used.
UnsupportedEncodingException - If the given encoding is not supported.| Access Rights |
|---|
| SC | DC |
|---|---|
[sap.com] ENGINEAPI
|
[sap.com] servlet_jsp
|
[sap.com] ENGFACADE
|
[sap.com] tc/je/webcontainer/public/api
|
[sap.com] CORE-TOOLS
|
[sap.com] com.sap.engine.client.lib
|
|
SAP NetWeaver 7.20 (SP01) Composition Environment | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||