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 select one of the following three predefined filters:
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.
![]() |
You can write filters for individual entries. Right-click the node for the JAR recipe entry in the Explorer 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 Updating a JAR File Running a JAR File Creating a JAR Manifest |