FileSet

The FileSet Element

The IzPack fileset concept has been adapted from the Apache Ant FileSet core type. Its functionality has been shrunken to the needs of IzPack.

IzPack FileSets are groups of source files. These files can be found in a directory tree starting in a base directory and are matched by patterns taken from a number of Selectors. FileSets can appear as nested elements inside installation descriptors and the ConfigurationInstallerListener to describe groups of source files for their enclosing parent element.

FileSet supports the nested <include> and <exclude> elements.

Selectors are available as nested elements.within the FileSet. If any of the selectors within the FileSet do not select the file, the file is not considered part of the FileSet. This makes FileSets equivalent to an <and> selector container.

Attribute

Description

Required

Default value

dir

The root of the directory tree of this FileSet

Yes

-
targetdir

The target root directory the installer should copy the included files later to.

Important: This attribute is just valid in case of nested filesets to the <pack> tag. It cannot be used for <parsable> and <executable>.

No${INSTALL_PATH}

includes

Comma- or space-separated list of patterns of files that must be included; all files are included when omitted.

No

-

excludes

Comma- or space-separated list of patterns of files that must be excluded; no files (except default excludes) are excluded when omitted

No

-

defaultexcludes

Indicates whether common default excludes (like .svn) should be used or not (true | false); default excludes are used when omitted.

Important: This attribute is just valid in case of nested filesets to the <pack> tag. It cannot be used for <parsable> and <executable>.

No

true

casesensitive

Must the include and exclude patterns be treated in a case sensitive way?

Important: This attribute is just valid in case of nested filesets to the <pack> tag. It cannot be used for <parsable> and <executable>.

No

true

followsymlinks

Shall symbolic links be followed? Defaults to true. See the note below.

Important: This attribute is just valid in case of nested filesets to the <pack> tag. It cannot be used for <parsable> and <executable>.

No

true

Note: All files/directories for which the canonical path is different from its path are considered symbolic links. On Unix systems this usually means the file really is a symbolic links but it may lead to false results on other platforms.

The <fileset> element can be used in the <packs> definitions with an enhanced set of attributes, see this documentation for more information.

Examples

<fileset dir="${user.dir}/staging" casesensitive="yes">
    <include name="*/.java"/>
    <exclude name="**/Test"/>
</fileset>

Groups all files in a given directory that are Java source files and don't have the text Test in their name.

<fileset dir="${user.dir}/staging" casesensitive="yes">
    <filename name="**/*.java"/>
    <not>
        <filename name="**/*Test*"/>
    </not>
</fileset>