Class MultipartPostBinderSerializer
java.lang.Object
oracle.stellent.ridc.model.serialize.MultipartPostBinderSerializer
Serializes a binder over a multipart post
-
Constructor Summary
ConstructorsConstructorDescriptionMultipartPostBinderSerializer(DataBinder dataBinder) MultipartPostBinderSerializer(DataBinder dataBinder, String encoding) -
Method Summary
Modifier and TypeMethodDescriptionlongprotected voidAdd the file post header information to the mapprotected StringcreateFilePostInfo(String name, TransferFile file) Create the post header for the file bytes send along in a multipart postprotected voidPackage together the local data in a multipost mannerprotected byte[]Utility function to obtain a byte stream based on the encoding set, or to the default system encoding if no encoding is set.protected voidCreate a large, randomly generated boundary string for separation of files and data in this multipart postvoidPrepare this object for a multipart postprotected voidsendFiles(OutputStream out) Send along all files into the output streamvoidwriteBinder(OutputStream out) Write the multipart post out to the given stream
-
Constructor Details
-
MultipartPostBinderSerializer
-
MultipartPostBinderSerializer
-
-
Method Details
-
getDataBinder
-
getPostString
-
getBreakString
-
prepareMultipartPost
public void prepareMultipartPost()Prepare this object for a multipart post -
countBytes
public long countBytes()- Returns:
- the number of bytes to send for this multipart post
-
writeBinder
Write the multipart post out to the given stream- Parameters:
out- the output stream- Throws:
IOException
-
prepareBoundary
protected void prepareBoundary()Create a large, randomly generated boundary string for separation of files and data in this multipart post -
createPostStr
protected void createPostStr()Package together the local data in a multipost manner -
createFilePostInfo
protected void createFilePostInfo()Add the file post header information to the map -
createFilePostInfo
Create the post header for the file bytes send along in a multipart post -
sendFiles
Send along all files into the output stream- Throws:
IOException
-
getBytes
Utility function to obtain a byte stream based on the encoding set, or to the default system encoding if no encoding is set.- Parameters:
str- the string to examine- Returns:
- the bytes for the encoding
- Throws:
UnsupportedEncodingException
-