ContentHandlerFactory
Stay organized with collections
Save and categorize content based on your preferences.
This interface defines a factory for content handlers. An
implementation of this interface should map a MIME type into an
instance of ContentHandler
.
This interface is used by the URLStreamHandler
class
to create a ContentHandler
for a MIME type.
Public Methods
public
abstract
ContentHandler
createContentHandler
(String mimetype)
Creates a new ContentHandler
to read an object from
a URLStreamHandler
.
Parameters
mimetype |
the MIME type for which a content handler is desired. |
Returns
- a new
ContentHandler
to read an object from a
URLStreamHandler
.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["`ContentHandlerFactory` is an interface that defines a factory for creating `ContentHandler` instances based on MIME types."],["Implementations map a MIME type to a corresponding `ContentHandler` for handling specific content types."],["It's primarily used by `URLStreamHandler` to obtain the appropriate `ContentHandler` for reading data from a URL."],["The core method, `createContentHandler(String mimetype)`, returns a new `ContentHandler` instance based on the provided MIME type."]]],["The `ContentHandlerFactory` interface maps MIME types to `ContentHandler` instances. Its primary function is fulfilled by the `createContentHandler` method. This method accepts a MIME type string as input and returns a new `ContentHandler` object. The `ContentHandler` is then used by a `URLStreamHandler` to read data associated with that specific MIME type. This factory provides a way to create handlers tailored to different content types fetched from a URL.\n"]]