Package org.eclipse.jetty.util
Class MultiPartWriter
- java.lang.Object
-
- java.io.Writer
-
- java.io.FilterWriter
-
- org.eclipse.jetty.util.MultiPartWriter
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
public class MultiPartWriter extends FilterWriter
Handle a multipart MIME response.
-
-
Field Summary
Fields Modifier and Type Field Description static StringMULTIPART_MIXEDstatic StringMULTIPART_X_MIXED_REPLACE-
Fields inherited from class java.io.FilterWriter
out
-
-
Constructor Summary
Constructors Constructor Description MultiPartWriter(Writer out)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()End the current part.voidendPart()end creation of the next Content.StringgetBoundary()voidstartPart(String contentType)Start creation of the next Content.voidstartPart(String contentType, String[] headers)Start creation of the next Content.-
Methods inherited from class java.io.FilterWriter
flush, write, write, write
-
-
-
-
Field Detail
-
MULTIPART_MIXED
public static final String MULTIPART_MIXED
- See Also:
- Constant Field Values
-
MULTIPART_X_MIXED_REPLACE
public static final String MULTIPART_X_MIXED_REPLACE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MultiPartWriter
public MultiPartWriter(Writer out) throws IOException
- Throws:
IOException
-
-
Method Detail
-
close
public void close() throws IOExceptionEnd the current part.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterWriter- Throws:
IOException- IOException
-
getBoundary
public String getBoundary()
-
startPart
public void startPart(String contentType) throws IOException
Start creation of the next Content.- Parameters:
contentType- the content type- Throws:
IOException- if unable to write the part
-
endPart
public void endPart() throws IOExceptionend creation of the next Content.- Throws:
IOException- if unable to write the part
-
startPart
public void startPart(String contentType, String[] headers) throws IOException
Start creation of the next Content.- Parameters:
contentType- the content type of the partheaders- the part headers- Throws:
IOException- if unable to write the part
-
-