URLStreamHandlerFactory
Stay organized with collections
Save and categorize content based on your preferences.
This interface defines a factory for URL
stream
protocol handlers.
It is used by the URL
class to create a
URLStreamHandler
for a specific protocol.
Public Methods
public
abstract
URLStreamHandler
createURLStreamHandler
(String protocol)
Creates a new URLStreamHandler
instance with the specified
protocol.
Parameters
protocol |
the protocol ("ftp ",
"http ", "nntp ", etc.). |
Returns
- a
URLStreamHandler
for the specific protocol.
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."],[[["\u003cp\u003eThe \u003ccode\u003eURLStreamHandlerFactory\u003c/code\u003e interface defines a factory for creating \u003ccode\u003eURL\u003c/code\u003e stream protocol handlers.\u003c/p\u003e\n"],["\u003cp\u003eIt's used by the \u003ccode\u003eURL\u003c/code\u003e class to create a \u003ccode\u003eURLStreamHandler\u003c/code\u003e for a given protocol.\u003c/p\u003e\n"],["\u003cp\u003eThe primary method, \u003ccode\u003ecreateURLStreamHandler\u003c/code\u003e, creates a new \u003ccode\u003eURLStreamHandler\u003c/code\u003e instance for a specific protocol like "http" or "ftp".\u003c/p\u003e\n"]]],[],null,["# URLStreamHandlerFactory\n\npublic interface **URLStreamHandlerFactory** \nThis interface defines a factory for `URL` stream\nprotocol handlers.\n\n\nIt is used by the `URL` class to create a\n`URLStreamHandler` for a specific protocol. \n\n##### See Also\n\n- [URL](../../../reference/java/net/URL.html)\n- [URLStreamHandler](../../../reference/java/net/URLStreamHandler.html) \n\n### Public Method Summary\n\n|--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [URLStreamHandler](../../../reference/java/net/URLStreamHandler.html) | [createURLStreamHandler](../../../reference/java/net/URLStreamHandlerFactory.html#createURLStreamHandler(java.lang.String))([String](../../../reference/java/lang/String.html) protocol) Creates a new `URLStreamHandler` instance with the specified protocol. |\n\nPublic Methods\n--------------\n\n#### public abstract [URLStreamHandler](../../../reference/java/net/URLStreamHandler.html)\n**createURLStreamHandler**\n([String](../../../reference/java/lang/String.html) protocol)\n\nCreates a new `URLStreamHandler` instance with the specified\nprotocol. \n\n##### Parameters\n\n| protocol | the protocol (\"`ftp`\", \"`http`\", \"`nntp`\", etc.). |\n|----------|---------------------------------------------------|\n\n##### Returns\n\n- a `URLStreamHandler` for the specific protocol. \n\n##### See Also\n\n- [URLStreamHandler](../../../reference/java/net/URLStreamHandler.html)"]]