public class CustomProtocolURLHandlerExtension extends java.lang.Object implements URLStreamHandlerWithLockPluginExtension, URLHandlerReadOnlyCheckerExtension
ADVICE_CLOSE, ADVICE_RELOAD, LOCATION_HEADER, OXYGEN_ACTION_HEADER
Constructor and Description |
---|
CustomProtocolURLHandlerExtension() |
Modifier and Type | Method and Description |
---|---|
boolean |
canCheckReadOnly(java.lang.String protocol)
Returns true if the implementor should be asked about the read-only status for URL's of a certain protocol.
|
LockHandler |
getLockHandler()
Get the lock handler for the current handled protocol.
|
java.net.URLStreamHandler |
getURLStreamHandler(java.lang.String protocol)
Gets the handler for the custom protocol
|
boolean |
isLockingSupported(java.lang.String protocol)
Check if a lock handler can be provided for a specific protocol.
|
boolean |
isReadOnly(java.net.URL url)
Decide if a given URL is read-only or writable to.
|
public java.net.URLStreamHandler getURLStreamHandler(java.lang.String protocol)
getURLStreamHandler
in interface URLStreamHandlerPluginExtension
protocol
- The name of the protocol.null
if it does not know it.public LockHandler getLockHandler()
LockHandlerFactoryPluginExtension
null
if not
supported.getLockHandler
in interface LockHandlerFactoryPluginExtension
null
if not supported.LockHandlerFactoryPluginExtension.getLockHandler()
public boolean isLockingSupported(java.lang.String protocol)
LockHandlerFactoryPluginExtension
isLockingSupported
in interface LockHandlerFactoryPluginExtension
protocol
- The URL protocol (like "http" or "file")true
if this extension can return a lock handler for
the protocol.LockHandlerFactoryPluginExtension.isLockingSupported(java.lang.String)
public boolean canCheckReadOnly(java.lang.String protocol)
URLHandlerReadOnlyCheckerExtension
canCheckReadOnly
in interface URLHandlerReadOnlyCheckerExtension
protocol
- The URL protocol (like "http" or "file")true
if the implementor should be asked about the read-only status for URL's of a certain protocol.
For example if you want to decide if "http" URLs are read-only or not you should return true
if the protocol is "http"
Then, the other callback will be called and you will be able to decide the read-only status for the URL.URLHandlerReadOnlyCheckerExtension.canCheckReadOnly(java.lang.String)
public boolean isReadOnly(java.net.URL url)
URLHandlerReadOnlyCheckerExtension
isReadOnly
in interface URLHandlerReadOnlyCheckerExtension
url
- The URL for which the implementor will decide if it is read-only or not.URLHandlerReadOnlyCheckerExtension.isReadOnly(java.net.URL)
© Copyright Syncro Soft SRL 2002 - 2014. All rights reserved.