Package org.apache.axiom.mime
Class ContentTypeBuilder
java.lang.Object
org.apache.axiom.mime.ContentTypeBuilder
Deprecated.
Builder for
ContentType objects. This class can be used to construct ContentType
objects or as a mutable alternative to ContentType (which is designed to be immutable).-
Constructor Summary
ConstructorsConstructorDescriptionContentTypeBuilder(String type) Deprecated.Constructor that parses aContent-Typeheader value.ContentTypeBuilder(org.apache.axiom.mime.ContentType type) Deprecated.Constructor that initializes the builder with the media type and parameters from an existingContentTypeobject.ContentTypeBuilder(org.apache.axiom.mime.MediaType mediaType) Deprecated.Constructor that initializes the builder with a media type and no parameters. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.axiom.mime.ContentTypebuild()Deprecated.Build theContentTypeobject.voidDeprecated.Remove all parameters.org.apache.axiom.mime.MediaTypeDeprecated.Get the media type.getParameter(String name) Deprecated.Get the specified parameter value.voidremoveParameter(String name) Deprecated.Remove the parameter with the specified name.voidsetMediaType(org.apache.axiom.mime.MediaType mediaType) Deprecated.Set the media type.voidsetParameter(String name, String value) Deprecated.Set the specified parameter value.toString()Deprecated.Create a string representation of the content type.
-
Constructor Details
-
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 existingContentTypeobject.- Parameters:
type- the content type
-
ContentTypeBuilder
Deprecated.Constructor that parses aContent-Typeheader value.- Parameters:
type- the value of theContent-Typeheader conforming to RFC 2045- Throws:
ParseException- if the value is invalid and could not be parsed
-
-
Method Details
-
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
Deprecated.Get the specified parameter value.- Parameters:
name- the parameter name- Returns:
- the parameter value, or
nullif no parameter with the given name was found
-
setParameter
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
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 theContentTypeobject.- Returns:
- the
ContentTypeobject
-
toString
Deprecated.Create a string representation of the content type. This method uses the same conventions asContentType.toString().
-
ContentType.Builderinstead.