com.izforge.izpack.event
Class AntAction

java.lang.Object
  extended by com.izforge.izpack.event.ActionBase
      extended by com.izforge.izpack.event.AntAction
All Implemented Interfaces:
java.io.Serializable

public class AntAction
extends ActionBase

This class contains data and 'perform' logic for ant action listeners.

Author:
Thomas Guenter, Klaus Bartz
See Also:
Serialized Form

Field Summary
static java.lang.String ANTACTION
           
static java.lang.String ANTACTIONS
           
static java.lang.String ANTCALL
           
private  java.lang.String buildFile
           
private  java.lang.String logFile
           
private  java.util.Properties properties
           
private  java.util.List propertyFiles
           
private  boolean quiet
           
private static long serialVersionUID
           
private  java.util.List targets
           
private  java.util.List uninstallTargets
           
private  boolean verbose
           
 
Fields inherited from class com.izforge.izpack.event.ActionBase
ACTION, AFTERDELETION, AFTERPACK, AFTERPACKS, ARCH, ASKFALSE, ASKTRUE, BEFOREDELETION, BEFOREPACK, BEFOREPACKS, BUILDFILE, CASESENSITIVE, COPY, EXCLUDE, EXCLUDES, FALSE, FAMILY, FILESET, INCLUDE, INCLUDES, LOGFILE, MAC, messageID, MESSAGEID, MOVE, NAME, NO, NOTHING, ONDEST, order, ORDER, OS, OVERRIDE, PACK, PATH, PROPERTY, PROPERTYFILE, QUIET, REMOVE, REWIND, SRCDIR, TARGET, TARGETDIR, TOUCH, TRUE, UNINSTALL_ACTION, UNINSTALL_ORDER, UNINSTALL_TARGET, uninstallOrder, UNIX, UPDATE, VALUE, VERBOSE, VERSION, WINDOWS, YES
 
Constructor Summary
AntAction()
          Default constructor
 
Method Summary
private  void addProperties(org.apache.tools.ant.Project proj, java.util.Properties props)
           
private  void addPropertiesFromPropertyFiles(org.apache.tools.ant.Project proj)
           
 void addPropertyFile(java.lang.String propertyFile)
          Adds one property file path to the internal list of property file paths.
 void addTarget(java.lang.String target)
          Adds the given target to the target list which should be performed at installation time.
 void addUninstallTarget(java.lang.String target)
          Adds the given target to the target list which should be performed at uninstallation time.
private  org.apache.tools.ant.BuildLogger createLogger()
           
 java.lang.String getBuildFile()
          Returns the build file.
 java.lang.String getLogFile()
          Returns the current logfile path as string.
 java.util.Properties getProperties()
          Returns the properties.
 java.lang.String getProperty(java.lang.String name)
          Returns the value for the property identified by the given name.
 java.util.List getPropertyFiles()
          Returns the property file paths as list of strings.
 java.util.List getTargets()
          Returns the targets.
 java.util.List getUninstallTargets()
          Returns the uninstaller targets.
 boolean isQuiet()
          Returns the quiet state.
 boolean isVerbose()
          Returns the verbose state.
 void performAction(boolean uninstall)
          Performs all defined actions.
 void performInstallAction()
          Performs all defined install actions.
 void performUninstallAction()
          Performs all defined uninstall actions.
 void setBuildFile(java.lang.String buildFile)
          Sets the build file to be used to the given string.
 void setLogFile(java.lang.String logFile)
          Sets the logfile path to the given string.
 void setProperties(java.util.Properties properties)
          Sets the internal properties to the given properties.
 void setProperty(java.lang.String name, java.lang.String value)
          Sets the given value to the property identified by the given name.
 void setPropertyFiles(java.util.List propertyFiles)
          Sets the property file path list to the given list.
 void setQuiet(boolean quiet)
          Sets whether the associated ant task should be performed quiet or not.
 void setTargets(java.util.ArrayList targets)
          Sets the targets which should be performed at installation time.
 void setUninstallTargets(java.util.ArrayList targets)
          Sets the targets which should be performed at uninstallation time.
 void setVerbose(boolean verbose)
          Sets the verbose state.
 
Methods inherited from class com.izforge.izpack.event.ActionBase
getMessageID, getOrder, getUninstallOrder, setMessageID, setOrder, setUninstallOrder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

ANTACTIONS

public static final java.lang.String ANTACTIONS
See Also:
Constant Field Values

ANTACTION

public static final java.lang.String ANTACTION
See Also:
Constant Field Values

ANTCALL

public static final java.lang.String ANTCALL
See Also:
Constant Field Values

quiet

private boolean quiet

verbose

private boolean verbose

properties

private java.util.Properties properties

targets

private java.util.List targets

uninstallTargets

private java.util.List uninstallTargets

logFile

private java.lang.String logFile

buildFile

private java.lang.String buildFile

propertyFiles

private java.util.List propertyFiles
Constructor Detail

AntAction

public AntAction()
Default constructor

Method Detail

performInstallAction

public void performInstallAction()
                          throws java.lang.Exception
Performs all defined install actions. Calls {#performAction performAction(false)}.

Throws:
java.lang.Exception

performUninstallAction

public void performUninstallAction()
                            throws java.lang.Exception
Performs all defined uninstall actions. Calls {#performAction performAction(true)}.

Throws:
java.lang.Exception

performAction

public void performAction(boolean uninstall)
                   throws java.lang.Exception
Performs all defined actions.

Parameters:
uninstall - An install/uninstall switch. If this is true only the uninstall actions, otherwise only the install actions are being performed.
Throws:
java.lang.Exception
See Also:
for calling all install actions., for calling all uninstall actions.

getBuildFile

public java.lang.String getBuildFile()
Returns the build file.

Returns:
the build file

setBuildFile

public void setBuildFile(java.lang.String buildFile)
Sets the build file to be used to the given string.

Parameters:
buildFile - build file path to be used

getLogFile

public java.lang.String getLogFile()
Returns the current logfile path as string.

Returns:
current logfile path

setLogFile

public void setLogFile(java.lang.String logFile)
Sets the logfile path to the given string.

Parameters:
logFile - to be set

getPropertyFiles

public java.util.List getPropertyFiles()
Returns the property file paths as list of strings.

Returns:
the property file paths

addPropertyFile

public void addPropertyFile(java.lang.String propertyFile)
Adds one property file path to the internal list of property file paths.

Parameters:
propertyFile - to be added

setPropertyFiles

public void setPropertyFiles(java.util.List propertyFiles)
Sets the property file path list to the given list. Old settings will be lost.

Parameters:
propertyFiles - list of property file paths to be set

getProperties

public java.util.Properties getProperties()
Returns the properties.

Returns:
the properties

setProperties

public void setProperties(java.util.Properties properties)
Sets the internal properties to the given properties. Old settings will be lost.

Parameters:
properties - properties to be set

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
Sets the given value to the property identified by the given name.

Parameters:
name - key of the property
value - value to be used for the property

getProperty

public java.lang.String getProperty(java.lang.String name)
Returns the value for the property identified by the given name.

Parameters:
name - name of the property
Returns:
value of the property

isQuiet

public boolean isQuiet()
Returns the quiet state.

Returns:
quiet state

setQuiet

public void setQuiet(boolean quiet)
Sets whether the associated ant task should be performed quiet or not.

Parameters:
quiet - quiet state to set

getTargets

public java.util.List getTargets()
Returns the targets.

Returns:
the targets

setTargets

public void setTargets(java.util.ArrayList targets)
Sets the targets which should be performed at installation time. Old settings are lost.

Parameters:
targets - list of targets

addTarget

public void addTarget(java.lang.String target)
Adds the given target to the target list which should be performed at installation time.

Parameters:
target - target to be add

getUninstallTargets

public java.util.List getUninstallTargets()
Returns the uninstaller targets.

Returns:
the uninstaller targets

setUninstallTargets

public void setUninstallTargets(java.util.ArrayList targets)
Sets the targets which should be performed at uninstallation time. Old settings are lost.

Parameters:
targets - list of targets

addUninstallTarget

public void addUninstallTarget(java.lang.String target)
Adds the given target to the target list which should be performed at uninstallation time.

Parameters:
target - target to be add

isVerbose

public boolean isVerbose()
Returns the verbose state.

Returns:
verbose state

setVerbose

public void setVerbose(boolean verbose)
Sets the verbose state.

Parameters:
verbose - state to be set

createLogger

private org.apache.tools.ant.BuildLogger createLogger()

addProperties

private void addProperties(org.apache.tools.ant.Project proj,
                           java.util.Properties props)

addPropertiesFromPropertyFiles

private void addPropertiesFromPropertyFiles(org.apache.tools.ant.Project proj)
                                     throws java.lang.Exception
Throws:
java.lang.Exception