| Modifier and Type | Field and Description |
|---|---|
static int |
NO_SIZE |
| Constructor and Description |
|---|
HttpPart(String partName,
byte[] content,
String contentType,
int size) |
HttpPart(String partName,
String fileName,
byte[] content,
String contentType,
int size) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(String headerName,
String headerValue) |
String |
getContentType()
Gets the content type of this part.
|
String |
getFileName() |
String |
getHeader(String headerName)
Returns the value of the specified mime header as a
String. |
Collection<String> |
getHeaderNames()
Gets the header names of this Part.
|
Collection<String> |
getHeaders(String headerName)
Gets the values of the Part header with the given name.
|
InputStream |
getInputStream()
Gets the content of this part as an
InputStream |
String |
getName()
Gets the name of this part
|
long |
getSize()
Returns the size of this file.
|
public static final int NO_SIZE
public String getContentType()
PartgetContentType in interface Partpublic String getHeader(String headerName)
PartString. If the Part did not include a header of the
specified name, this method returns null. If there are multiple headers with the same name, this method returns
the first header in the part. The header name is case insensitive. You can use this method with any request header.public Collection<String> getHeaderNames()
Part
Some servlet containers do not allow servlets to access headers using this method, in which case this method returns
null
Any changes to the returned Collection must not affect this Part.
getHeaderNames in interface PartCollection of the header names of this Partpublic Collection<String> getHeaders(String headerName)
Part
Any changes to the returned Collection must not affect this Part.
Part header names are case insensitive.
getHeaders in interface PartheaderName - the header name whose values to returnCollection of the values of the header with the given namepublic InputStream getInputStream() throws IOException
PartInputStreamgetInputStream in interface PartInputStreamIOException - If an error occurs in retrieving the content as an InputStreampublic long getSize()
Partpublic String getFileName()
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.