- java.lang.Object
-
- javax.net.SocketFactory
-
- org.newsclub.net.unix.AFUNIXSocketFactory
-
- org.newsclub.net.unix.AFUNIXSocketFactory.URIScheme
-
- Enclosing class:
- AFUNIXSocketFactory
public static final class AFUNIXSocketFactory.URIScheme extends AFUNIXSocketFactory
A socket factory that handles special host names formatted as file:// URIs. The file:// URI may also be specified in URL-encoded format, i.e., file:%3A%2F%2F etc. You may also surround the URL with square brackets ("[" and "]"), whereas the closing bracket may be omitted. NOTE: In some circumstances it is recommended to use "[file:%3A%2F%2F(...)", i.e. encoded and without the closing bracket. Since this is an invalid hostname, it will not trigger a DNS lookup, but can still be used within a JDBC Connection URL.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.newsclub.net.unix.AFUNIXSocketFactory
AFUNIXSocketFactory.FactoryArg, AFUNIXSocketFactory.SystemProperty, AFUNIXSocketFactory.URIScheme
-
-
Constructor Summary
Constructors Constructor Description URIScheme()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AFUNIXSocketAddressaddressFromHost(java.lang.String host, int port)Translates a "host" string (and port) to anAFUNIXSocketAddress.protected booleanisHostnameSupported(java.lang.String host)Checks whether the given hostname is supported by this socket factory.-
Methods inherited from class org.newsclub.net.unix.AFUNIXSocketFactory
createSocket, createSocket, createSocket, createSocket, createSocket, isInetAddressSupported
-
-
-
-
Method Detail
-
isHostnameSupported
protected boolean isHostnameSupported(java.lang.String host)
Description copied from class:AFUNIXSocketFactoryChecks whether the given hostname is supported by this socket factory. If not, calls to createSocket will cause an UnknownHostException.- Overrides:
isHostnameSupportedin classAFUNIXSocketFactory- Parameters:
host- The host to check.- Returns:
trueif supported.
-
addressFromHost
protected AFUNIXSocketAddress addressFromHost(java.lang.String host, int port) throws java.io.IOException
Description copied from class:AFUNIXSocketFactoryTranslates a "host" string (and port) to anAFUNIXSocketAddress.- Specified by:
addressFromHostin classAFUNIXSocketFactory- Parameters:
host- The hostnameport- The port, or 0.- Returns:
- The
AFUNIXSocketAddress - Throws:
java.io.IOException- If there was a problem converting the hostname
-
-