Setting a JAR Content Filter

See Also

In the File Filter property editor, you can set a filter for the JAR packager to use when creating the JAR file.

To set a JAR content filter:

You can also create a custom filter by writing a POSIX-style regular expression. If your syntax is invalid, the text turns red. Select the Negative checkbox if the regular expression is written for files that you want to exclude from the JAR. The custom filter is stored in the JAR recipe file, so you can use or edit the filter if you later modify the JAR.

The following table provides some examples of regular expressions you can write.

Regular Expression Description
.*html$Include all HTML files
.*java$Include all Java files
(.*html$)|(.*java$)Include all HTML and Java files
(Key)|(.*gif$)Include all GIF files and any files with Key in their name

You can find a guide to regular expression syntax at http://jakarta.apache.org/regexp/apidocs/org/apache/regexp/RE.html.

Tip You can write filters for individual entries. Right-click the node for the JAR recipe entry in the Filesystems window and select Properties. On the property sheet, select the File Filter property and click the ellipsis (...) button to open the File Filter property editor. When you specify a filter for an individual entry, both that filter and the filter specified in the File Filter property editor must be satisfied for files to be included in the JAR file.
See Also
Creating a JAR Contents File
The JAR Contents Property Editor
Modifying a JAR File

Legal Notices