public class MultipartPostBinderSerializer extends Object
Constructor and Description |
---|
MultipartPostBinderSerializer(DataBinder dataBinder) |
MultipartPostBinderSerializer(DataBinder dataBinder,
String encoding) |
Modifier and Type | Method and Description |
---|---|
long |
countBytes() |
protected void |
createFilePostInfo()
Add the file post header information to the map
|
protected String |
createFilePostInfo(String name,
TransferFile file)
Create the post header for the file bytes send along in a multipart post
|
protected void |
createPostStr()
Package together the local data in a multipost manner
|
String |
getBreakString() |
protected byte[] |
getBytes(String str)
Utility function to obtain a byte stream based on the encoding set, or
to the default system encoding if no encoding is set.
|
DataBinder |
getDataBinder() |
String |
getPostString() |
protected void |
prepareBoundary()
Create a large, randomly generated boundary string for separation of
files and data in this multipart post
|
void |
prepareMultipartPost()
Prepare this object for a multipart post
|
protected void |
sendFiles(OutputStream out)
Send along all files into the output stream
|
void |
writeBinder(OutputStream out)
Write the multipart post out to the given stream
|
public MultipartPostBinderSerializer(DataBinder dataBinder)
public MultipartPostBinderSerializer(DataBinder dataBinder, String encoding)
public DataBinder getDataBinder()
public String getPostString()
public String getBreakString()
public void prepareMultipartPost()
public long countBytes()
public void writeBinder(OutputStream out) throws IOException
out
- the output streamIOException
protected void prepareBoundary()
protected void createPostStr()
protected void createFilePostInfo()
protected String createFilePostInfo(String name, TransferFile file)
protected void sendFiles(OutputStream out) throws IOException
IOException
protected byte[] getBytes(String str) throws UnsupportedEncodingException
str
- the string to examineUnsupportedEncodingException