Constructor and Description |
---|
Part() |
Modifier and Type | Method and Description |
---|---|
static String |
getBoundary()
Deprecated.
uses a constant string. Rather use
getPartBoundary() |
abstract String |
getCharSet()
Return the character encoding of this part.
|
abstract String |
getContentType()
Returns the content type of this part.
|
static long |
getLengthOfParts(Part[] parts)
Return the total sum of all parts and that of the last boundary
|
static long |
getLengthOfParts(Part[] parts,
byte[] partBoundary)
Gets the length of the multipart message including the given parts.
|
abstract String |
getName()
Return the name of this part.
|
abstract String |
getTransferEncoding()
Return the transfer encoding of this part.
|
boolean |
isRepeatable()
Tests if this part can be sent more than once.
|
long |
length()
Return the full length of all the data.
|
void |
send(OutputStream out)
Write all the data to the output stream.
|
static void |
sendParts(OutputStream out,
Part[] parts)
Write all parts and the last boundary to the specified output stream.
|
static void |
sendParts(OutputStream out,
Part[] parts,
byte[] partBoundary)
Write all parts and the last boundary to the specified output stream.
|
String |
toString()
Return a string representation of this object.
|
public static String getBoundary()
getPartBoundary()
public abstract String getName()
public abstract String getContentType()
null
to exclude the content type headerpublic abstract String getCharSet()
null
to exclude the character
encoding headerpublic abstract String getTransferEncoding()
null
to exclude the transfer encoding headerpublic boolean isRepeatable()
true
if sendData(OutputStream)
can be successfully called
more than once.public void send(OutputStream out) throws IOException
out
- The output streamIOException
- If an IO problem occurs.public long length() throws IOException
IOException
- If an IO problem occurspublic String toString()
toString
in class Object
Object.toString()
public static void sendParts(OutputStream out, Part[] parts) throws IOException
out
- The stream to write to.parts
- The parts to write.IOException
- If an I/O error occurs while writing the parts.public static void sendParts(OutputStream out, Part[] parts, byte[] partBoundary) throws IOException
out
- The stream to write to.parts
- The parts to write.partBoundary
- The ASCII bytes to use as the part boundary.IOException
- If an I/O error occurs while writing the parts.public static long getLengthOfParts(Part[] parts) throws IOException
parts
- The parts.IOException
- If an I/O error occurs while writing the parts.public static long getLengthOfParts(Part[] parts, byte[] partBoundary) throws IOException
parts
- The parts.partBoundary
- The ASCII bytes to use as the part boundary.IOException
- If an I/O error occurs while writing the parts.Copyright © 2010 - 2020 Adobe. All Rights Reserved