com.ibm.gcs.netutil
Class GCSURLStreamHandlerFactory
java.lang.Object
|
+--com.ibm.gcs.netutil.GCSURLStreamHandlerFactory
- All Implemented Interfaces:
- java.net.URLStreamHandlerFactory
- public class GCSURLStreamHandlerFactory
- extends java.lang.Object
- implements java.net.URLStreamHandlerFactory
The GCSURLStreamHandlerFactory is an implementation of the
java.net.URLStreamHandlerFactory
.
It is used to create GCS-specfic java.net.URLStreamHandler
instances for handling different protocols.
- See Also:
URLStreamHandlerFactory
,
GCSHttpStreamHandler
,
GCSFileStreamHandler
,
GCSNntpStreamHandler
Method Summary |
java.net.URLStreamHandler |
createURLStreamHandler(java.lang.String protocol)
based on the 'protocol' string in the URL object, return an
appropriate GCS-specific stream handler. |
static boolean |
isProtocolInURLSupported(java.lang.String urlStr)
returns true if the protocol in urlStr is supported by GCS |
static boolean |
isProtocolSupported(java.lang.String str)
returns true if the protocol in str is supported by GCS |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
supportedProtocols
public static final java.lang.String[] supportedProtocols
GCSURLStreamHandlerFactory
public GCSURLStreamHandlerFactory()
- (constructor)
isProtocolSupported
public static boolean isProtocolSupported(java.lang.String str)
- returns true if the protocol in
str
is supported by GCS
- Parameters:
str
- the protocol that is being checked- Returns:
- true if protocol
str
is supported, false otherwise
isProtocolInURLSupported
public static boolean isProtocolInURLSupported(java.lang.String urlStr)
- returns true if the protocol in
urlStr
is supported by GCS
- Parameters:
str
- the URLString whose protocol is being checked- Returns:
- true if protocol in the url string
urlStr
is supported, false otherwise
createURLStreamHandler
public java.net.URLStreamHandler createURLStreamHandler(java.lang.String protocol)
- based on the 'protocol' string in the URL object, return an
appropriate GCS-specific stream handler.
Currently it handles three protocols:
http - returns
GCSHttpStreamHandler
,
nntp (or news) - returns GCSNntpStreamHandler
,
gcsfile (or file) - returns GCSFileStreamHandler
- Specified by:
createURLStreamHandler
in interface java.net.URLStreamHandlerFactory
- Parameters:
protocol
- protocol string- Returns:
- URLStreamHandler object that corresponds to the protocol
- Throws:
GCSStreamHandlerNotSupported
- thrown when the protocol is not understood- See Also:
URLStreamHandler
,
GCSFileStreamHandler
,
GCSNntpStreamHandler
(c) Copyright International Business Machines Corporation 1996, 2002. IBM Corp. All rights reserved.