Interface InputPart
- All Known Implementing Classes:
MultipartInputImpl.PartImpl
public interface InputPart
Represents one part of a multipart message.
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault InputStream
getBody()
Returns the body content as an input stream.<T> T
getBody
(jakarta.ws.rs.core.GenericType<T> type) <T> T
default String
Returns the filename parameter of the content disposition of this Entity.jakarta.ws.rs.core.MediaType
boolean
void
setMediaType
(jakarta.ws.rs.core.MediaType mediaType) Change the media type of the body part before you extract it.
-
Field Details
-
DEFAULT_CONTENT_TYPE_PROPERTY
If no content-type header is sent in a multipart message part "text/plain; charset=ISO-8859-1" is assumed.This can be overwritten by setting a different String value in
HttpRequest.setAttribute(String, Object)
with this ("resteasy.provider.multipart.inputpart.defaultContentType") String as key. It should be done in aContainerRequestFilter
.- See Also:
-
DEFAULT_CHARSET_PROPERTY
If there is a content-type header without a charset parameter, charset=US-ASCII is assumed.This can be overwritten by setting a different String value in
HttpRequest.setAttribute(String, Object)
with this ("resteasy.provider.multipart.inputpart.defaultCharset") String as key. It should be done in aContainerRequestFilter
.- See Also:
-
-
Method Details
-
getHeaders
-
getBodyAsString
- Throws:
IOException
-
getBody
- Throws:
IOException
-
getBody
- Throws:
IOException
-
getBody
Returns the body content as an input stream.- Returns:
- the body content
- Throws:
IOException
- if an error occurs reading the content
-
getFileName
Returns the filename parameter of the content disposition of this Entity.- Returns:
- the filename or
null
if one does not exist
-
getMediaType
jakarta.ws.rs.core.MediaType getMediaType()- Returns:
- "Content-Type" of this part
-
isContentTypeFromMessage
boolean isContentTypeFromMessage()- Returns:
- true if the Content-Type was resolved from the message, false if it was resolved from the server default
-
setMediaType
void setMediaType(jakarta.ws.rs.core.MediaType mediaType) Change the media type of the body part before you extract it. Useful for specifying a charset.- Parameters:
mediaType
- media type
-