Package org.apache.axiom.mime
Class ContentTypeBuilder
- java.lang.Object
-
- org.apache.axiom.mime.ContentTypeBuilder
-
public final class ContentTypeBuilder extends Object
Deprecated.UseContentType.Builder
instead.Builder forContentType
objects. This class can be used to constructContentType
objects or as a mutable alternative toContentType
(which is designed to be immutable).
-
-
Constructor Summary
Constructors Constructor Description ContentTypeBuilder(String type)
Deprecated.Constructor that parses aContent-Type
header value.ContentTypeBuilder(org.apache.axiom.mime.ContentType type)
Deprecated.Constructor that initializes the builder with the media type and parameters from an existingContentType
object.ContentTypeBuilder(org.apache.axiom.mime.MediaType mediaType)
Deprecated.Constructor that initializes the builder with a media type and no parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.apache.axiom.mime.ContentType
build()
Deprecated.Build theContentType
object.void
clearParameters()
Deprecated.Remove all parameters.org.apache.axiom.mime.MediaType
getMediaType()
Deprecated.Get the media type.String
getParameter(String name)
Deprecated.Get the specified parameter value.void
removeParameter(String name)
Deprecated.Remove the parameter with the specified name.void
setMediaType(org.apache.axiom.mime.MediaType mediaType)
Deprecated.Set the media type.void
setParameter(String name, String value)
Deprecated.Set the specified parameter value.String
toString()
Deprecated.Create a string representation of the content type.
-
-
-
Constructor Detail
-
ContentTypeBuilder
public ContentTypeBuilder(org.apache.axiom.mime.MediaType mediaType)
Deprecated.Constructor that initializes the builder with a media type and no parameters.- Parameters:
mediaType
- the media type
-
ContentTypeBuilder
public ContentTypeBuilder(org.apache.axiom.mime.ContentType type)
Deprecated.Constructor that initializes the builder with the media type and parameters from an existingContentType
object.- Parameters:
type
- the content type
-
ContentTypeBuilder
public ContentTypeBuilder(String type) throws ParseException
Deprecated.Constructor that parses aContent-Type
header value.- Parameters:
type
- the value of theContent-Type
header conforming to RFC 2045- Throws:
ParseException
- if the value is invalid and could not be parsed
-
-
Method Detail
-
getMediaType
public org.apache.axiom.mime.MediaType getMediaType()
Deprecated.Get the media type.- Returns:
- the media type
-
setMediaType
public void setMediaType(org.apache.axiom.mime.MediaType mediaType)
Deprecated.Set the media type.- Parameters:
mediaType
- the media type
-
getParameter
public String getParameter(String name)
Deprecated.Get the specified parameter value.- Parameters:
name
- the parameter name- Returns:
- the parameter value, or
null
if no parameter with the given name was found
-
setParameter
public void setParameter(String name, String value)
Deprecated.Set the specified parameter value. If a parameter with the given name already exists, it will be replaced. Note that parameter names are case insensitive.- Parameters:
name
- the parameter namevalue
- the parameter value
-
removeParameter
public void removeParameter(String name)
Deprecated.Remove the parameter with the specified name.- Parameters:
name
- the parameter name
-
clearParameters
public void clearParameters()
Deprecated.Remove all parameters.
-
build
public org.apache.axiom.mime.ContentType build()
Deprecated.Build theContentType
object.- Returns:
- the
ContentType
object
-
-