- All Implemented Interfaces:
Address
Under normal conditions it is not necessary to use
this class to use jCIFS properly. Name resolusion is
handled internally to the org.codelibs.jcifs.smb.impl package.
This class is a wrapper for both NbtAddress
and InetAddress. The name resolution mechanisms
used will systematically query all available configured resolution
services including WINS, broadcasts, DNS, and LMHOSTS. See
Setting Name Resolution Properties
and the org.codelibs.jcifs.smb.resolveOrder property. Changing
jCIFS name resolution properties can greatly affect the behavior of
the client and may be necessary for proper operation.
This class should be used in favor of InetAddress to resolve
hostnames on LANs and WANs that support a mixture of NetBIOS/WINS and
DNS resolvable hosts.
-
Constructor Summary
ConstructorsConstructorDescriptionUniAddress(Object addr) Create aUniAddressby wrapping anInetAddressorNbtAddress. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompare two addresses for equality.Guess first called name to try for session establishment.Return the underlyingNbtAddressorInetAddress.Return the IP address as text such as "192.168.1.15".Return the hostname of this address such as "MYCOMPUTER".inthashCode()Return the IP address of this address as a 32 bit integer.static booleanisDotQuadIP(String hostname) Check whether a hostname is actually an ip addressGuess next called name to try for session establishment.Converts this address to an InetAddress.toString()Return the a text representation of this address such asMYCOMPUTER/192.168.1.15.<T extends Address>
TUnwrap the address to a specific type
-
Constructor Details
-
UniAddress
Create aUniAddressby wrapping anInetAddressorNbtAddress.- Parameters:
addr- wrapped address
-
-
Method Details
-
isDotQuadIP
Check whether a hostname is actually an ip address- Parameters:
hostname- the hostname to check- Returns:
- whether this is an IP address
-
hashCode
public int hashCode()Return the IP address of this address as a 32 bit integer. -
equals
Compare two addresses for equality. TwoUniAddresss are equal if they are bothUniAddress' and refer to the same IP address. -
firstCalledName
Guess first called name to try for session establishment. This method is used exclusively by theorg.codelibs.jcifs.smb.implpackage.- Specified by:
firstCalledNamein interfaceAddress- Returns:
- the guessed name
-
nextCalledName
Guess next called name to try for session establishment. This method is used exclusively by theorg.codelibs.jcifs.smb.implpackage.- Specified by:
nextCalledNamein interfaceAddress- Parameters:
tc- context to use- Returns:
- guessed alternate name
-
getAddress
Return the underlyingNbtAddressorInetAddress.- Returns:
- wrapped address
-
getHostName
Return the hostname of this address such as "MYCOMPUTER".- Specified by:
getHostNamein interfaceAddress- Returns:
- the hostname associated with the address
-
getHostAddress
Return the IP address as text such as "192.168.1.15".- Specified by:
getHostAddressin interfaceAddress- Returns:
- the ip address
-
toInetAddress
Converts this address to an InetAddress.- Specified by:
toInetAddressin interfaceAddress- Returns:
- this address as an InetAddress
- Throws:
UnknownHostException- if the host cannot be resolved- See Also:
-
unwrap
Unwrap the address to a specific type -
toString
Return the a text representation of this address such asMYCOMPUTER/192.168.1.15.
-