Stay organized with collections
Save and categorize content based on your preferences.
URLStreamHandlerFactory
public
interface
URLStreamHandlerFactory
java.net.URLStreamHandlerFactory
|
This interface defines a factory for URL
stream
protocol handlers.
A URL stream handler factory is used as specified in the
URL constructor.
Summary
Public methods
createURLStreamHandler
public abstract URLStreamHandler createURLStreamHandler (String protocol)
Creates a new URLStreamHandler
instance with the specified
protocol.
Parameters |
protocol |
String : the protocol ("ftp ",
"http ", "nntp ", etc.). |
Returns |
URLStreamHandler |
a URLStreamHandler for the specific protocol, or null if this factory cannot create a handler for the specific
protocol |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# URLStreamHandlerFactory\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nURLStreamHandlerFactory\n=======================\n\n\n`\npublic\n\n\ninterface\nURLStreamHandlerFactory\n`\n\n\n`\n\n\n`\n\n|----------------------------------|\n| java.net.URLStreamHandlerFactory |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nThis interface defines a factory for `URL` stream\nprotocol handlers.\n\nA URL stream handler factory is used as specified in the\n[URL constructor](/reference/java/net/URL#URL(java.lang.String,%20java.lang.String,%20int,%20java.lang.String)). \n**See also:**\n\n- [URL](/reference/java/net/URL)\n- [URLStreamHandler](/reference/java/net/URLStreamHandler)\n\nSummary\n-------\n\n| ### Public methods ||\n|----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[URLStreamHandler](/reference/java/net/URLStreamHandler) | ` `[createURLStreamHandler](/reference/java/net/URLStreamHandlerFactory#createURLStreamHandler(java.lang.String))`(`[String](/reference/java/lang/String)` protocol) ` Creates a new `URLStreamHandler` instance with the specified protocol. |\n\nPublic methods\n--------------\n\n### createURLStreamHandler\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract URLStreamHandler createURLStreamHandler (String protocol)\n```\n\nCreates a new `URLStreamHandler` instance with the specified\nprotocol.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|------------|--------------------------------------------------------------------|\n| `protocol` | `String`: the protocol (\"`ftp`\", \"`http`\", \"`nntp`\", etc.). \u003cbr /\u003e |\n\n| Returns ||\n|----------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|\n| [URLStreamHandler](/reference/java/net/URLStreamHandler) | a `URLStreamHandler` for the specific protocol, or `null` if this factory cannot create a handler for the specific protocol \u003cbr /\u003e |\n\n**See also:**\n\n- [URLStreamHandler](/reference/java/net/URLStreamHandler)"]]