Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs

public Class HostInfo

extends Task
Class Inheritance
Imports
java.net.Inet4Address, .Inet6Address, .InetAddress, .NetworkInterface, java.util.Arrays, .Collections, .LinkedList, .List, org.apache.tools.ant.BuildException, .Project, .Task

Sets properties to the host provided, or localhost if no information is provided. The default properties are NAME, FQDN, ADDR4, ADDR6;
Since
Ant 1.8

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private InetAddress
private InetAddress
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private String
private List<InetAddress>
private static final String
private InetAddress
private String
Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
execute()

Overrides org.apache.tools.ant.Task.execute.

set the properties.
private void
private void
private boolean
private void
private InetAddress
private void
public void
setHost(String
the name or the address of the host, data for the local host will be retrieved if omitted.
aHost
)

Set the host to be retrieved.

public void
setPrefix(String
the prefix to use.
aPrefix
)

Set a prefix for the properties.

private void
setProperty(String name, String value)

Inherited from org.apache.tools.ant.Task:
bindToOwnergetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

ADDR4back to summary
private static final String ADDR4
ADDR6back to summary
private static final String ADDR6
best4back to summary
private InetAddress best4
best6back to summary
private InetAddress best6
DEF_DOMAINback to summary
private static final String DEF_DOMAIN
DEF_LOCAL_ADDR4back to summary
private static final String DEF_LOCAL_ADDR4
DEF_LOCAL_ADDR6back to summary
private static final String DEF_LOCAL_ADDR6
DEF_LOCAL_NAMEback to summary
private static final String DEF_LOCAL_NAME
DEF_REM_ADDR4back to summary
private static final String DEF_REM_ADDR4
DEF_REM_ADDR6back to summary
private static final String DEF_REM_ADDR6
DOMAINback to summary
private static final String DOMAIN
hostback to summary
private String host
inetAddrsback to summary
private List<InetAddress> inetAddrs
NAMEback to summary
private static final String NAME
nameAddrback to summary
private InetAddress nameAddr
prefixback to summary
private String prefix

Constructor Detail

HostInfoback to summary
public HostInfo()

Method Detail

executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

set the properties.

Annotations
@Override
Exceptions
BuildException:
on error.
executeLocalback to summary
private void executeLocal()
executeRemoteback to summary
private void executeRemote()
hasHostNameback to summary
private boolean hasHostName(InetAddress addr)
selectAddressesback to summary
private void selectAddresses()
selectBestAddressback to summary
private InetAddress selectBestAddress(InetAddress bestSoFar, InetAddress current)
setDomainAndNameback to summary
private void setDomainAndName(String fqdn)
setHostback to summary
public void setHost(String aHost)

Set the host to be retrieved.

Parameters
aHost:String

the name or the address of the host, data for the local host will be retrieved if omitted.

Since
Ant 1.8
setPrefixback to summary
public void setPrefix(String aPrefix)

Set a prefix for the properties. If the prefix does not end with a "." one is automatically added.

Parameters
aPrefix:String

the prefix to use.

Since
Ant 1.8
setPropertyback to summary
private void setProperty(String name, String value)