We need you!

Icon

The IzPack documentation needs work, and you are invited to edit it!

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Mapping File Names

The IzPack fileset concept has been adapted from the Apache Ant File Name Mapper type.

During copying and manipulating with files during an IzPack installation you might want to specify, how should the target files be named depending on the source files, for instance replacing a filename suffix by a different one.

While source files are usually specified as filesets filesets, you don't specify target files directly - instead, you tell IzPack how to find the target file(s) for one source file. An instance of the FileNameMapper class is responsible for this. It constructs target file names based on rules that can be parameterized with from and to attributes - the exact meaning of which is implementation-dependent.

These instances are defined in <mapper> elements with the following attributes:

Attribute

Description

Required

type

specifies one of the built-in implementations.

Exactly one of these

classname

specifies the implementation by class name.

classpath

the classpath to use when looking up classname.

No

from

the from attribute for the given implementation.

Depends on implementation.

to

the to attribute for the given implementation.

Depends on implementation.

Note that IzPack will not automatically convert / or \ characters in the to and from attributes to the correct directory separator of your current platform. If you need to specify this separator, use ${file.separator} instead. For the regexpmapper, ${file.separator} will not work, as on windows it is the '\' character, and this is an escape character for regular expressions, one should use the handledirsep attribute instead.

Nested Elements

The classpath can be specified via a nested <classpath>, as well - that is, a path-like structure.

Nested File Mappers can be supplied via either <mapper> elements. If nested File Mappers are specified by either means, the mapper will be implicitly configured as a composite mapper.

...

Mapper

...

Type Reference

All built-in mappers are case-sensitive.

...

Attribute

Description

Required

casesensitive

If this is false, the mapper will ignore case when matching the glob pattern. This attribute can be true or false, the default is true.

No

handledirsep

If this is specified, the mapper will ignore the difference between the normal directory separator characters - \\\\\\\\\
and /. This attribute can be true or false, the default is false.This attribute is useful for cross-platform build files.

No

...

Attribute

Description

Required

casesensitive

If this is false, the mapper will ignore case when matching the pattern. This attribute can be true or false, the default is true.

No

handledirsep

If this is specified, the mapper will treat a \ character in a filename as a / for the purposes of matching. This attribute can be true or false, the default is false. This attribute is useful for cross-platform build files.

No

Anchor
composite-mapper
composite-mapper

composite

This mapper implementation can contain multiple nested mappers. File mapping is performed by passing the source filename to each nested mapper in turn, returning all results. The to and from attributes are ignored.

...