public class DirContextURLStreamHandler extends URLStreamHandler
Modifier and Type | Field and Description |
---|---|
protected DirContext |
context
Directory context.
|
Constructor and Description |
---|
DirContextURLStreamHandler() |
DirContextURLStreamHandler(DirContext context) |
Modifier and Type | Method and Description |
---|---|
static void |
bind(ClassLoader cl,
DirContext dirContext)
Binds a directory context to a class loader.
|
static void |
bind(DirContext dirContext)
Binds a directory context to a class loader.
|
static void |
bindThread(DirContext dirContext)
Binds a directory context to a thread.
|
static DirContext |
get()
Get the bound context.
|
static DirContext |
get(ClassLoader cl)
Get the bound context.
|
static DirContext |
get(Thread thread)
Get the bound context.
|
static boolean |
isBound()
Returns true if the thread or the context class loader of the current
thread is bound.
|
protected URLConnection |
openConnection(URL u)
Opens a connection to the object referenced by the
URL
argument. |
static void |
setProtocolHandler()
Set the java.protocol.handler.pkgs system property.
|
protected String |
toExternalForm(URL u)
Converts a
URL of a specific protocol to a
String . |
static void |
unbind()
Unbinds a directory context to a class loader.
|
static void |
unbind(ClassLoader cl)
Unbinds a directory context to a class loader.
|
static void |
unbindThread()
Unbinds a directory context to a thread.
|
equals, getDefaultPort, getHostAddress, hashCode, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL
protected DirContext context
public DirContextURLStreamHandler()
public DirContextURLStreamHandler(DirContext context)
protected URLConnection openConnection(URL u) throws IOException
URL
argument.openConnection
in class URLStreamHandler
IOException
public static void setProtocolHandler()
public static boolean isBound()
public static void bind(DirContext dirContext)
public static void unbind()
public static void bindThread(DirContext dirContext)
public static void unbindThread()
public static DirContext get()
public static void bind(ClassLoader cl, DirContext dirContext)
public static void unbind(ClassLoader cl)
public static DirContext get(ClassLoader cl)
public static DirContext get(Thread thread)
protected String toExternalForm(URL u)
URL
of a specific protocol to a
String
.
The impl of this method is almost identical to that of the
java.net.URLStreamHandler superclass, except that it omits the
URL's authority field from the URL's String representation.toExternalForm
in class URLStreamHandler
u
- the URL.URL
argument.Copyright © 2019. All rights reserved.