|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object toolbox.web.util.Part
public class Part
Class defining a single part of a multipart/form-data request. Provides methods to obtain the content type and contents of a specific part.
Constructor Summary | |
---|---|
Part()
Default constructor. |
Method Summary | |
---|---|
byte[] |
getContent()
Returns the content of this part as a byte array. |
java.lang.String |
getContentAsString()
Returns the content of this part as a String |
java.lang.String |
getContentType()
Returns the content type of this part. |
java.lang.String |
getFilename()
Returns the filename of this part. |
java.lang.String |
getName()
Returns the name of this part. |
void |
setContentType(java.lang.String contentType)
Set the content type of this part if denotes a part containing file. |
void |
setFilename(java.lang.String filename)
Set the filename of this part if it denotes a part containing file. |
void |
setName(java.lang.String name)
Set the name of this part. |
void |
write(byte[] data,
int offSet,
int len)
Writes the given byte array to this part. |
void |
writeTo(java.io.OutputStream os)
Writes all the contents of this part to the given OutputStream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Part()
Method Detail |
---|
public void setName(java.lang.String name)
name
- String containing the name of this part.public java.lang.String getName()
public void setContentType(java.lang.String contentType)
contentType
- String containing the content type of this part.public java.lang.String getContentType()
public void setFilename(java.lang.String filename)
filename
- String containing the filename of this part.public java.lang.String getFilename()
public void write(byte[] data, int offSet, int len)
data
- Byte array containing data to write to this part.offSet
- Start at this position in the array.len
- Stop at this position in the array.public void writeTo(java.io.OutputStream os) throws java.io.IOException
os
- Write part content to this OutputStream.
java.io.IOException
- if the write operation fails.public byte[] getContent()
public java.lang.String getContentAsString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |