public interface Part
Part
object is used to represent a part within
a request message. Typically a part represents either a text
parameter or a file, with associated headers. The contents of
the part can be acquire as an InputStream
or as a
string encoded in the default HTTP encoding ISO-8859-1 or in
the encoding specified with the Content-Type header.Modifier and Type | Method and Description |
---|---|
String |
getContent()
This is used to acquire the content of the part as a string.
|
ContentType |
getContentType()
This is used to acquire the content type for this part.
|
String |
getFileName()
This method is used to acquire the file name of the part.
|
String |
getHeader(String name)
This is used to acquire the header value for the specified
header name.
|
InputStream |
getInputStream()
This is used to acquire an
InputStream for the
part. |
String |
getName()
This method is used to acquire the name of the part.
|
boolean |
isFile()
This method is used to determine the type of a part.
|
boolean isFile()
String getName()
String getFileName()
String getHeader(String name)
name
- the name of the header to get the value forString getContent() throws IOException
IOException
- thrown if the content can not be createdInputStream getInputStream() throws IOException
InputStream
for the
part. Acquiring the stream allows the content of the part to
be consumed by reading the stream. Each invocation of this
method will produce a new stream starting from the first byte.IOException
- thrown if the stream can not be createdContentType getContentType()
Copyright © 2019. All rights reserved.