Class Part
java.lang.Object
org.apache.commons.httpclient.methods.multipart.Part
- Direct Known Subclasses:
PartBase
Deprecated.
Jakarta Commons HttpClient 3.x is deprecated in the Jenkins project.
It is not recommended to use it in any new code.
Instead, use HTTP client API plugins as a dependency in your code.
E.g.
Apache HttpComponents Client API 4.x Plugin or
Async HTTP Client Plugin.
Abstract class for one Part of a multipart post object.
- Since:
- 2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringDeprecated.uses a constant string.abstract StringDeprecated.Return the character encoding of this part.abstract StringDeprecated.Returns the content type of this part.static longgetLengthOfParts(Part[] parts) Deprecated.Return the total sum of all parts and that of the last boundarystatic longgetLengthOfParts(Part[] parts, byte[] partBoundary) Deprecated.Gets the length of the multipart message including the given parts.abstract StringgetName()Deprecated.Return the name of this part.abstract StringDeprecated.Return the transfer encoding of this part.booleanDeprecated.Tests if this part can be sent more than once.longlength()Deprecated.Return the full length of all the data.voidsend(OutputStream out) Deprecated.Write all the data to the output stream.static voidsendParts(OutputStream out, Part[] parts) Deprecated.Write all parts and the last boundary to the specified output stream.static voidsendParts(OutputStream out, Part[] parts, byte[] partBoundary) Deprecated.Write all parts and the last boundary to the specified output stream.toString()Deprecated.Return a string representation of this object.
-
Constructor Details
-
Part
public Part()Deprecated.
-
-
Method Details
-
getBoundary
Deprecated.uses a constant string. Rather usegetPartBoundary()Return the boundary string.- Returns:
- the boundary string
-
getName
Deprecated.Return the name of this part.- Returns:
- The name.
-
getContentType
Deprecated.Returns the content type of this part.- Returns:
- the content type, or
nullto exclude the content type header
-
getCharSet
Deprecated.Return the character encoding of this part.- Returns:
- the character encoding, or
nullto exclude the character encoding header
-
getTransferEncoding
Deprecated.Return the transfer encoding of this part.- Returns:
- the transfer encoding, or
nullto exclude the transfer encoding header
-
isRepeatable
public boolean isRepeatable()Deprecated.Tests if this part can be sent more than once.- Returns:
trueifsendData(OutputStream)can be successfully called more than once.- Since:
- 3.0
-
send
Deprecated.Write all the data to the output stream. If you override this method make sure to override #length() as well- Parameters:
out- The output stream- Throws:
IOException- If an IO problem occurs.
-
length
Deprecated.Return the full length of all the data. If you override this method make sure to override #send(OutputStream) as well- Returns:
- long The length.
- Throws:
IOException- If an IO problem occurs
-
toString
Deprecated.Return a string representation of this object. -
sendParts
Deprecated.Write all parts and the last boundary to the specified output stream.- Parameters:
out- The stream to write to.parts- The parts to write.- Throws:
IOException- If an I/O error occurs while writing the parts.
-
sendParts
public static void sendParts(OutputStream out, Part[] parts, byte[] partBoundary) throws IOException Deprecated.Write all parts and the last boundary to the specified output stream.- Parameters:
out- The stream to write to.parts- The parts to write.partBoundary- The ASCII bytes to use as the part boundary.- Throws:
IOException- If an I/O error occurs while writing the parts.- Since:
- 3.0
-
getLengthOfParts
Deprecated.Return the total sum of all parts and that of the last boundary- Parameters:
parts- The parts.- Returns:
- The total length
- Throws:
IOException- If an I/O error occurs while writing the parts.
-
getLengthOfParts
Deprecated.Gets the length of the multipart message including the given parts.- Parameters:
parts- The parts.partBoundary- The ASCII bytes to use as the part boundary.- Returns:
- The total length
- Throws:
IOException- If an I/O error occurs while writing the parts.- Since:
- 3.0
-