com.izforge.izpack.compiler
Class PackInfo

java.lang.Object
  extended by com.izforge.izpack.compiler.PackInfo

public class PackInfo
extends java.lang.Object

Temporary holding place for Pack information as the Packager is built. The packager is used by the compiler to collect info about an installer, and finally create the actual installer files.

Author:
Chadwick McHenry

Field Summary
static int BLACK
          black colour
 int colour
          The color of the node.
private  java.util.List executables
          Executable files in this Pack.
private  java.util.Map files
          Files of the Pack.
static int GREY
          grey colour
private  Pack pack
          The pack object serialized in the installer.
private  java.util.List parsables
          Parsables files in this Pack.
private  java.util.List updateChecks
          Update check specifications in this Pack.
static int WHITE
          white colour
 
Constructor Summary
PackInfo(java.lang.String name, java.lang.String id, java.lang.String description, boolean required, boolean loose, java.lang.String excludegroup, boolean uninstall)
          Constructor with required info.
 
Method Summary
 void addDependency(java.lang.String dependency)
          The packs that this file depends on
 void addExecutable(ExecutableFile executable)
          Executables files have their executable flag set, may be executed, and optionally, deleted when finished executing.
 void addFile(java.io.File baseDir, java.io.File file, java.lang.String targetfile, java.util.List<OsConstraint> osList, int override, java.util.Map additionals, java.lang.String condition)
          Add a file or directory to be installed.
 void addInstallGroup(java.lang.String group)
          Add an install group to the pack.
 void addParsable(ParsableFile parsable)
          Parsable files have variables substituted after installation.
 void addUpdateCheck(UpdateCheck updateCheck)
          Executables files have their executable flag set, may be executed, and optionally, deleted when finished executing.
 java.lang.String getCondition()
           
 java.util.List<java.lang.String> getDependencies()
           
 java.util.List getExecutables()
          List of parsables for this Pack.
 java.io.File getFile(PackFile packFile)
          The file described by the specified PackFile.
 java.lang.String getGroup()
          Get the pack group.
 java.util.Set<java.lang.String> getInstallGroups()
          Get the install group names.
 java.util.List<OsConstraint> getOsConstraints(java.util.List osConstraints)
           
 Pack getPack()
           
 java.util.Set getPackFiles()
          Set of PackFile objects for this Pack.
 java.lang.String getParent()
           
 java.util.List getParsables()
          List of parsables for this Pack.
 java.util.List getUpdateChecks()
          List of update checks for this Pack.
 boolean hasInstallGroup(java.lang.String group)
          See if the pack is associated with the given install group.
 boolean isPreselected()
           
 void setCondition(java.lang.String condition)
           
 void setDependencies(java.util.List<java.lang.String> dependencies)
          ******************************************************************************************** Attributes of the Pack ********************************************************************************************
 void setExcludeGroup(java.lang.String group)
          Set the name of the group which contains the packs which exludes mutual.
 void setGroup(java.lang.String group)
          Set the pack group.
 void setOsConstraints(java.util.List<OsConstraint> osConstraints)
           
 void setPackImgId(java.lang.String packImgId)
           
 void setParent(java.lang.String p)
           
 void setPreselected(boolean preselected)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pack

private Pack pack
The pack object serialized in the installer.


colour

public int colour
The color of the node. This is used for the dependency graph algorithms


WHITE

public static final int WHITE
white colour

See Also:
Constant Field Values

GREY

public static final int GREY
grey colour

See Also:
Constant Field Values

BLACK

public static final int BLACK
black colour

See Also:
Constant Field Values

files

private java.util.Map files
Files of the Pack.


parsables

private java.util.List parsables
Parsables files in this Pack.


executables

private java.util.List executables
Executable files in this Pack.


updateChecks

private java.util.List updateChecks
Update check specifications in this Pack.

Constructor Detail

PackInfo

public PackInfo(java.lang.String name,
                java.lang.String id,
                java.lang.String description,
                boolean required,
                boolean loose,
                java.lang.String excludegroup,
                boolean uninstall)
Constructor with required info.

Parameters:
name - name of the pack
id - id of the pack e.g. to resolve I18N
description - descripton in English
required - pack is required or not
loose - files of pack should be stored separatly or not
excludegroup - name of the exclude group
uninstall - pack must be uninstalled
Method Detail

setDependencies

public void setDependencies(java.util.List<java.lang.String> dependencies)
******************************************************************************************** Attributes of the Pack ********************************************************************************************


setExcludeGroup

public void setExcludeGroup(java.lang.String group)
Set the name of the group which contains the packs which exludes mutual.

Parameters:
group - name of the mutal exclude group

setOsConstraints

public void setOsConstraints(java.util.List<OsConstraint> osConstraints)

getOsConstraints

public java.util.List<OsConstraint> getOsConstraints(java.util.List osConstraints)

setPreselected

public void setPreselected(boolean preselected)

isPreselected

public boolean isPreselected()

getGroup

public java.lang.String getGroup()
Get the pack group.

Returns:
Get the pack group, null if there is no group.

setGroup

public void setGroup(java.lang.String group)
Set the pack group.

Parameters:
group - the group to associate the pack with.

addInstallGroup

public void addInstallGroup(java.lang.String group)
Add an install group to the pack.

Parameters:
group - the install group to associate the pack with.

hasInstallGroup

public boolean hasInstallGroup(java.lang.String group)
See if the pack is associated with the given install group.

Parameters:
group - the install group name to check
Returns:
true if the given group is associated with the pack.

getInstallGroups

public java.util.Set<java.lang.String> getInstallGroups()
Get the install group names.

Returns:
Set for the install groups

getPack

public Pack getPack()

addFile

public void addFile(java.io.File baseDir,
                    java.io.File file,
                    java.lang.String targetfile,
                    java.util.List<OsConstraint> osList,
                    int override,
                    java.util.Map additionals,
                    java.lang.String condition)
             throws java.io.FileNotFoundException
Add a file or directory to be installed.

Parameters:
file - the file or basedir to be installed.
targetfile - path file will be installed to.
osList - the target operation system(s) of this pack.
override - what to do if the file already exists when installing
condition -
Throws:
java.io.FileNotFoundException - if the file specified does not exist. The file is not read until the Packager.createInstaller(java.io.File) is invoked, thus a FileNotFoundEception will occur then, if the file is deleted in between.

getPackFiles

public java.util.Set getPackFiles()
Set of PackFile objects for this Pack.


getFile

public java.io.File getFile(PackFile packFile)
The file described by the specified PackFile. Returns null if the PackFile did not come from the set returned by getPackFiles().


addParsable

public void addParsable(ParsableFile parsable)
Parsable files have variables substituted after installation.


getParsables

public java.util.List getParsables()
List of parsables for this Pack.


addExecutable

public void addExecutable(ExecutableFile executable)
Executables files have their executable flag set, may be executed, and optionally, deleted when finished executing.


getExecutables

public java.util.List getExecutables()
List of parsables for this Pack.


addUpdateCheck

public void addUpdateCheck(UpdateCheck updateCheck)
Executables files have their executable flag set, may be executed, and optionally, deleted when finished executing.


getUpdateChecks

public java.util.List getUpdateChecks()
List of update checks for this Pack.


addDependency

public void addDependency(java.lang.String dependency)
The packs that this file depends on


getDependencies

public java.util.List<java.lang.String> getDependencies()

getParent

public java.lang.String getParent()

setParent

public void setParent(java.lang.String p)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setPackImgId

public void setPackImgId(java.lang.String packImgId)

getCondition

public java.lang.String getCondition()
Returns:
the condition

setCondition

public void setCondition(java.lang.String condition)
Parameters:
condition - the condition to set