public class MultiPartWriter
extends java.io.FilterWriter
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
__CRLF |
private static java.lang.String |
__DASHDASH |
private java.lang.String |
boundary |
private boolean |
inPart |
static java.lang.String |
MULTIPART_MIXED |
static java.lang.String |
MULTIPART_X_MIXED_REPLACE |
Constructor and Description |
---|
MultiPartWriter(java.io.Writer out) |
Modifier and Type | Method and Description |
---|---|
void |
close()
End the current part.
|
void |
endPart()
end creation of the next Content.
|
java.lang.String |
getBoundary() |
void |
startPart(java.lang.String contentType)
Start creation of the next Content.
|
void |
startPart(java.lang.String contentType,
java.lang.String[] headers)
Start creation of the next Content.
|
private static final java.lang.String __CRLF
private static final java.lang.String __DASHDASH
public static final java.lang.String MULTIPART_MIXED
public static final java.lang.String MULTIPART_X_MIXED_REPLACE
private java.lang.String boundary
private boolean inPart
public MultiPartWriter(java.io.Writer out) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.FilterWriter
java.io.IOException
- IOExceptionpublic java.lang.String getBoundary()
public void startPart(java.lang.String contentType) throws java.io.IOException
contentType
- the content typejava.io.IOException
- if unable to write the partpublic void endPart() throws java.io.IOException
java.io.IOException
- if unable to write the partpublic void startPart(java.lang.String contentType, java.lang.String[] headers) throws java.io.IOException
contentType
- the content type of the partheaders
- the part headersjava.io.IOException
- if unable to write the part