filter -> condition

This commit is contained in:
Oliver Spohngellert 2016-02-18 17:23:58 -05:00
parent a15750199b
commit 730ee53fc7
7 changed files with 292 additions and 285 deletions

View File

@ -21,7 +21,7 @@ FilesSetRulePanel.nameRegexCheckbox.text=Regex
FilesSetRulePanel.ruleNameTextField.text= FilesSetRulePanel.ruleNameTextField.text=
FilesSetRulePanel.nameTextField.text= FilesSetRulePanel.nameTextField.text=
FilesSetRulePanel.ruleNameLabel.text=Rule Name: FilesSetRulePanel.ruleNameLabel.text=Rule Name:
FilesSetRulePanel.messages.emptyNameFilter=You must specify a name pattern for this rule. FilesSetRulePanel.messages.emptyNameCondition=You must specify a name pattern for this rule.
FilesSetRulePanel.messages.invalidNameRegex=The name regular expression is not valid:\n\n{0} FilesSetRulePanel.messages.invalidNameRegex=The name regular expression is not valid:\n\n{0}
FilesSetRulePanel.messages.invalidCharInName=The name cannot contain \\, /, :, *, ?, \", <, or > unless it is a regular expression. FilesSetRulePanel.messages.invalidCharInName=The name cannot contain \\, /, :, *, ?, \", <, or > unless it is a regular expression.
FilesSetRulePanel.messages.invalidCharInPath=The path cannot contain \\, :, *, ?, \", <, or > unless it is a regular expression. FilesSetRulePanel.messages.invalidCharInPath=The path cannot contain \\, :, *, ?, \", <, or > unless it is a regular expression.
@ -42,7 +42,6 @@ InterestingItemDefsPanel.jLabel6.text=Set Details
InterestingItemDefsPanel.jLabel8.text=File Size: InterestingItemDefsPanel.jLabel8.text=File Size:
InterestingItemDefsPanel.jLabel7.text=MIME Type: InterestingItemDefsPanel.jLabel7.text=MIME Type:
InterestingItemDefsPanel.jTextArea1.text=This module allows you to find files that match specified criteria. Each set has a list of rules, which will match on file name and parent path patterns. InterestingItemDefsPanel.jTextArea1.text=This module allows you to find files that match specified criteria. Each set has a list of rules, which will match on file name and parent path patterns.
InterestingItemDefsPanel.rulePathFilterRegexCheckBox.text=Regex
InterestingItemDefsPanel.jLabel4.text=Path Pattern: InterestingItemDefsPanel.jLabel4.text=Path Pattern:
InterestingItemDefsPanel.jLabel1.text=Rule Details InterestingItemDefsPanel.jLabel1.text=Rule Details
InterestingItemDefsPanel.dirsRadioButton.text=Directories InterestingItemDefsPanel.dirsRadioButton.text=Directories
@ -54,7 +53,6 @@ InterestingItemDefsPanel.bothRadioButton.text=Files and Directories
InterestingItemDefsPanel.setsListLabel.text=Rule Sets InterestingItemDefsPanel.setsListLabel.text=Rule Sets
InterestingItemDefsPanel.fileNameRegexCheckbox.text=Regex InterestingItemDefsPanel.fileNameRegexCheckbox.text=Regex
InterestingItemDefsPanel.ignoreKnownFilesCheckbox.text=Ignore Known Files InterestingItemDefsPanel.ignoreKnownFilesCheckbox.text=Ignore Known Files
InterestingItemDefsPanel.rulePathFilterTextField.text=
InterestingItemDefsPanel.fileNameRadioButton.text=File Name InterestingItemDefsPanel.fileNameRadioButton.text=File Name
InterestingItemDefsPanel.jLabel5.text=Description: InterestingItemDefsPanel.jLabel5.text=Description:
InterestingItemDefsPanel.fileNameTextField.text= InterestingItemDefsPanel.fileNameTextField.text=
@ -65,3 +63,5 @@ InterestingItemDefsPanel.rulesListLabel.text=Rules:
InterestingItemDefsPanel.editRuleButton.text=Edit Rule InterestingItemDefsPanel.editRuleButton.text=Edit Rule
InterestingItemDefsPanel.filesRadioButton.text=Files InterestingItemDefsPanel.filesRadioButton.text=Files
InterestingItemDefsPanel.newRuleButton.text=New Rule InterestingItemDefsPanel.newRuleButton.text=New Rule
InterestingItemDefsPanel.rulePathConditionTextField.text=
InterestingItemDefsPanel.rulePathConditionRegexCheckBox.text=Regex

View File

@ -35,8 +35,6 @@ InterestingItemDefsPanel.doFileSetsDialog.duplicateRuleSet.text=\u540d\u524d\u30
FilesSetRulePanel.jLabel5.text=\u898b\u3064\u3051\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u306e\u60c5\u5831\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 FilesSetRulePanel.jLabel5.text=\u898b\u3064\u3051\u305f\u3044\u30d5\u30a1\u30a4\u30eb\u306e\u60c5\u5831\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002
InterestingItemDefsPanel.jTextArea1.text=\u6307\u5b9a\u3055\u308c\u305f\u6761\u4ef6\u3068\u4e00\u81f4\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u691c\u7d22\u3059\u308b\u306e\u304c\u53ef\u80fd\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3059\u3002\u5404\u30bb\u30c3\u30c8\u306b\u306f\u30d5\u30a1\u30a4\u30eb\u540d\u304a\u3088\u3073\u30da\u30a2\u30ec\u30f3\u30c8\u30d1\u30b9\u30d1\u30bf\u30fc\u30f3\u3092\u3082\u3068\u306b\u4e00\u81f4\u3059\u308b\u3001\u30eb\u30fc\u30eb\u30ea\u30b9\u30c8\u304c\u3042\u308a\u307e\u3059\u3002 InterestingItemDefsPanel.jTextArea1.text=\u6307\u5b9a\u3055\u308c\u305f\u6761\u4ef6\u3068\u4e00\u81f4\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u691c\u7d22\u3059\u308b\u306e\u304c\u53ef\u80fd\u306a\u30e2\u30b8\u30e5\u30fc\u30eb\u3067\u3059\u3002\u5404\u30bb\u30c3\u30c8\u306b\u306f\u30d5\u30a1\u30a4\u30eb\u540d\u304a\u3088\u3073\u30da\u30a2\u30ec\u30f3\u30c8\u30d1\u30b9\u30d1\u30bf\u30fc\u30f3\u3092\u3082\u3068\u306b\u4e00\u81f4\u3059\u308b\u3001\u30eb\u30fc\u30eb\u30ea\u30b9\u30c8\u304c\u3042\u308a\u307e\u3059\u3002
InterestingItemDefsPanel.rulePathFilterRegexCheckBox.text=\u6b63\u898f\u8868\u73fe
InterestingItemDefsPanel.jLabel4.text=\u30d1\u30b9\u30d1\u30bf\u30fc\u30f3\uff1a InterestingItemDefsPanel.jLabel4.text=\u30d1\u30b9\u30d1\u30bf\u30fc\u30f3\uff1a
InterestingItemDefsPanel.jLabel1.text=\u30eb\u30fc\u30eb\u8a73\u7d30 InterestingItemDefsPanel.jLabel1.text=\u30eb\u30fc\u30eb\u8a73\u7d30
@ -78,3 +76,4 @@ InterestingItemDefsPanel.filesRadioButton.text=\u30d5\u30a1\u30a4\u30eb
InterestingItemDefsPanel.newRuleButton.text=\u65b0\u898f\u30eb\u30fc\u30eb InterestingItemDefsPanel.newRuleButton.text=\u65b0\u898f\u30eb\u30fc\u30eb
InterestingItemDefsPanel.jLabel6.text=\u30bb\u30c3\u30c8\u8a73\u7d30 InterestingItemDefsPanel.jLabel6.text=\u30bb\u30c3\u30c8\u8a73\u7d30
InterestingItemDefsPanel.rulePathConditionRegexCheckBox.text=\u6b63\u898f\u8868\u73fe

View File

@ -18,6 +18,7 @@
*/ */
package org.sleuthkit.autopsy.modules.interestingitems; package org.sleuthkit.autopsy.modules.interestingitems;
import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -35,8 +36,9 @@ import org.sleuthkit.datamodel.TskData;
* Interesting files set definition objects are immutable, so they may be safely * Interesting files set definition objects are immutable, so they may be safely
* published to multiple threads. * published to multiple threads.
*/ */
final class FilesSet { final class FilesSet implements Serializable {
private static final long serialVersionUID = 1L;
private final String name; private final String name;
private final String description; private final String description;
private final boolean ignoreKnownFiles; private final boolean ignoreKnownFiles;
@ -135,33 +137,34 @@ final class FilesSet {
* A set membership rule for an interesting files set. The immutability of a * A set membership rule for an interesting files set. The immutability of a
* rule object allows it to be safely published to multiple threads. * rule object allows it to be safely published to multiple threads.
*/ */
static class Rule { static class Rule implements Serializable {
private static final long serialVersionUID = 1L;
private final String uuid; private final String uuid;
private final String ruleName; private final String ruleName;
private final FileNameFilter fileNameFilter; private final FileNameCondition fileNameCondition;
private final MetaTypeCondition metaTypeFilter; private final MetaTypeCondition metaTypeCondition;
private final ParentPathFilter pathFilter; private final ParentPathCondition pathCondition;
private final MimeTypeCondition mimeTypeFilter; private final MimeTypeCondition mimeTypeCondition;
private final FileSizeCondition fileSizeFilter; private final FileSizeCondition fileSizeCondition;
private final List<FileAttributeCondition> filters = new ArrayList<>(); private final List<FileAttributeCondition> conditions = new ArrayList<>();
/** /**
* Construct an interesting files set membership rule. * Construct an interesting files set membership rule.
* *
* @param ruleName The name of the rule. * @param ruleName The name of the rule.
* @param fileNameFilter A file name filter. * @param fileNameCondition A file name condition.
* @param metaTypeFilter A file meta-type filter. * @param metaTypeCondition A file meta-type condition.
* @param pathFilter A file path filter, may be null. * @param pathCondition A file path condition, may be null.
*/ */
Rule(String ruleName, FileNameFilter fileNameFilter, MetaTypeCondition metaTypeFilter, ParentPathFilter pathFilter, MimeTypeCondition mimeTypeFilter, FileSizeCondition fileSizeFilter) { Rule(String ruleName, FileNameCondition fileNameCondition, MetaTypeCondition metaTypeCondition, ParentPathCondition pathCondition, MimeTypeCondition mimeTypeCondition, FileSizeCondition fileSizeCondition) {
// since ruleName is optional, ruleUUID can be used to uniquely identify a rule. // since ruleName is optional, ruleUUID can be used to uniquely identify a rule.
this.uuid = UUID.randomUUID().toString(); this.uuid = UUID.randomUUID().toString();
if (metaTypeFilter == null) { if (metaTypeCondition == null) {
throw new IllegalArgumentException("Interesting files set rule meta-type filter cannot be null"); throw new IllegalArgumentException("Interesting files set rule meta-type condition cannot be null");
} }
if (ruleName == null && fileNameFilter == null && mimeTypeFilter == null) { if (ruleName == null && fileNameCondition == null && mimeTypeCondition == null) {
throw new IllegalArgumentException("Must have at least one filter on rule."); throw new IllegalArgumentException("Must have at least one condition on rule.");
} }
this.ruleName = ruleName; this.ruleName = ruleName;
@ -170,28 +173,28 @@ final class FilesSet {
* The rules are evaluated in the order added. MetaType check is * The rules are evaluated in the order added. MetaType check is
* fastest, so do it first * fastest, so do it first
*/ */
this.metaTypeFilter = metaTypeFilter; this.metaTypeCondition = metaTypeCondition;
if (this.metaTypeFilter != null) { if (this.metaTypeCondition != null) {
this.filters.add(this.metaTypeFilter); this.conditions.add(this.metaTypeCondition);
} }
this.fileNameFilter = fileNameFilter; this.fileNameCondition = fileNameCondition;
if (this.fileNameFilter != null) { if (this.fileNameCondition != null) {
this.filters.add(fileNameFilter); this.conditions.add(fileNameCondition);
} }
this.mimeTypeFilter = mimeTypeFilter; this.mimeTypeCondition = mimeTypeCondition;
if (this.mimeTypeFilter != null) { if (this.mimeTypeCondition != null) {
this.filters.add(mimeTypeFilter); this.conditions.add(mimeTypeCondition);
} }
this.pathFilter = pathFilter; this.pathCondition = pathCondition;
if (this.pathFilter != null) { if (this.pathCondition != null) {
this.filters.add(this.pathFilter); this.conditions.add(this.pathCondition);
} }
this.fileSizeFilter = fileSizeFilter; this.fileSizeCondition = fileSizeCondition;
if (this.fileSizeFilter != null) { if (this.fileSizeCondition != null) {
this.filters.add(this.fileSizeFilter); this.conditions.add(this.fileSizeCondition);
} }
} }
@ -205,30 +208,30 @@ final class FilesSet {
} }
/** /**
* Get the file name filter for the rule. * Get the file name condition for the rule.
* *
* @return A file name filter. * @return A file name condition.
*/ */
FileNameFilter getFileNameFilter() { FileNameCondition getFileNameCondition() {
return this.fileNameFilter; return this.fileNameCondition;
} }
/** /**
* Get the meta-type filter for the rule. * Get the meta-type condition for the rule.
* *
* @return A meta-type filter. * @return A meta-type condition.
*/ */
MetaTypeCondition getMetaTypeFilter() { MetaTypeCondition getMetaTypeCondition() {
return this.metaTypeFilter; return this.metaTypeCondition;
} }
/** /**
* Get the path filter for the rule. * Get the path condition for the rule.
* *
* @return A path filter, may be null. * @return A path condition, may be null.
*/ */
ParentPathFilter getPathFilter() { ParentPathCondition getPathCondition() {
return this.pathFilter; return this.pathCondition;
} }
/** /**
@ -239,8 +242,8 @@ final class FilesSet {
* @return True if the rule is satisfied, false otherwise. * @return True if the rule is satisfied, false otherwise.
*/ */
boolean isSatisfied(AbstractFile file) { boolean isSatisfied(AbstractFile file) {
for (FileAttributeCondition filter : filters) { for (FileAttributeCondition condition : conditions) {
if (!filter.passes(file)) { if (!condition.passes(file)) {
return false; return false;
} }
} }
@ -254,7 +257,7 @@ final class FilesSet {
public String toString() { public String toString() {
// This override is designed to provide a display name for use with // This override is designed to provide a display name for use with
// javax.swing.DefaultListModel<E>. // javax.swing.DefaultListModel<E>.
return this.ruleName + " (" + fileNameFilter.getTextToMatch() + ")"; return this.ruleName + " (" + fileNameCondition.getTextToMatch() + ")";
} }
/** /**
@ -265,20 +268,21 @@ final class FilesSet {
} }
/** /**
* @return the mimeTypeFilter * @return the mimeTypeCondition
*/ */
public MimeTypeCondition getMimeTypeFilter() { public MimeTypeCondition getMimeTypeCondition() {
return mimeTypeFilter; return mimeTypeCondition;
} }
/** /**
* An interface for the file attribute filters of which interesting * An interface for the file attribute conditions of which interesting
* files set membership rules are composed. * files set membership rules are composed.
*/ */
static interface FileAttributeCondition { static interface FileAttributeCondition extends Serializable {
/** /**
* Tests whether or not a file satisfies the conditions of a filter. * Tests whether or not a file satisfies the conditions of a
* condition.
* *
* @param file The file to test. * @param file The file to test.
* *
@ -288,16 +292,17 @@ final class FilesSet {
} }
/** /**
* A class for filtering files based upon their MIME types. * A class for checking files based upon their MIME types.
*/ */
static final class MimeTypeCondition implements FileAttributeCondition { static final class MimeTypeCondition implements FileAttributeCondition {
private static final long serialVersionUID = 1L;
private String mimeType; private String mimeType;
/** /**
* Constructs a MimeTypeFilter * Constructs a MimeTypeCondition
* *
* @param mimeType The mime type to filter for * @param mimeType The mime type to condition for
*/ */
MimeTypeCondition(String mimeType) { MimeTypeCondition(String mimeType) {
this.mimeType = mimeType; this.mimeType = mimeType;
@ -312,7 +317,7 @@ final class FilesSet {
} }
/** /**
* Gets the mime type that is being filtered * Gets the mime type that is being checked
* *
* @return the mime type * @return the mime type
*/ */
@ -324,6 +329,8 @@ final class FilesSet {
static final class FileSizeCondition implements FileAttributeCondition { static final class FileSizeCondition implements FileAttributeCondition {
private static final long serialVersionUID = 1L;
static enum COMPARATOR { static enum COMPARATOR {
LESS_THAN, LESS_THAN,
@ -335,20 +342,15 @@ final class FilesSet {
public static COMPARATOR fromSymbol(String symbol) { public static COMPARATOR fromSymbol(String symbol) {
if (symbol.equals("<=") || symbol.equals("")) { if (symbol.equals("<=") || symbol.equals("")) {
return LESS_THAN_EQUAL; return LESS_THAN_EQUAL;
} } else if (symbol.equals("<")) {
else if (symbol.equals("<")) {
return LESS_THAN; return LESS_THAN;
} } else if (symbol.equals("==") || symbol.equals("=")) {
else if (symbol.equals("==") || symbol.equals("=")) {
return EQUAL; return EQUAL;
} } else if (symbol.equals(">")) {
else if (symbol.equals(">")) {
return GREATER_THAN; return GREATER_THAN;
} } else if (symbol.equals(">=") || symbol.equals("")) {
else if (symbol.equals(">=") || symbol.equals("")) {
return GREATER_THAN_EQUAL; return GREATER_THAN_EQUAL;
} } else {
else {
throw new IllegalArgumentException("Invalid symbol"); throw new IllegalArgumentException("Invalid symbol");
} }
} }
@ -373,17 +375,13 @@ final class FilesSet {
public static SIZE_UNIT fromName(String name) { public static SIZE_UNIT fromName(String name) {
if (name.equals("Bytes")) { if (name.equals("Bytes")) {
return BYTE; return BYTE;
} } else if (name.equals("Kilobytes")) {
else if (name.equals("Kilobytes")) {
return KILOBYTE; return KILOBYTE;
} } else if (name.equals("Megabytes")) {
else if (name.equals("Megabytes")) {
return MEGABYTE; return MEGABYTE;
} } else if (name.equals("Gigabytes")) {
else if (name.equals("Gigabytes")) {
return GIGABYTE; return GIGABYTE;
} } else {
else {
throw new IllegalArgumentException("Invalid symbol"); throw new IllegalArgumentException("Invalid symbol");
} }
} }
@ -401,18 +399,18 @@ final class FilesSet {
@Override @Override
public boolean passes(AbstractFile file) { public boolean passes(AbstractFile file) {
long fileSize = file.getSize(); long fileSize = file.getSize();
long filterSize = this.unit.getSize() * this.sizeValue; long conditionSize = this.unit.getSize() * this.sizeValue;
switch (this.comparator) { switch (this.comparator) {
case GREATER_THAN: case GREATER_THAN:
return fileSize > filterSize; return fileSize > conditionSize;
case GREATER_THAN_EQUAL: case GREATER_THAN_EQUAL:
return fileSize >= filterSize; return fileSize >= conditionSize;
case LESS_THAN_EQUAL: case LESS_THAN_EQUAL:
return fileSize <= filterSize; return fileSize <= conditionSize;
case LESS_THAN: case LESS_THAN:
return fileSize < filterSize; return fileSize < conditionSize;
default: default:
return fileSize == filterSize; return fileSize == conditionSize;
} }
} }
@ -420,12 +418,14 @@ final class FilesSet {
} }
/** /**
* A file meta-type filter for an interesting files set membership rule. * A file meta-type condition for an interesting files set membership
* The immutability of a meta-type filter object allows it to be safely * rule. The immutability of a meta-type condition object allows it to
* published to multiple threads. * be safely published to multiple threads.
*/ */
static final class MetaTypeCondition implements FileAttributeCondition { static final class MetaTypeCondition implements FileAttributeCondition {
private static final long serialVersionUID = 1L;
enum Type { enum Type {
FILES, FILES,
@ -436,7 +436,7 @@ final class FilesSet {
private final Type type; private final Type type;
/** /**
* Construct a meta-type filter. * Construct a meta-type condition.
* *
* @param metaType The meta-type to match, must. * @param metaType The meta-type to match, must.
*/ */
@ -461,7 +461,7 @@ final class FilesSet {
} }
/** /**
* Gets the meta-type the filter matches. * Gets the meta-type the condition matches.
* *
* @return A member of the MetaTypeCondition.Type enumeration. * @return A member of the MetaTypeCondition.Type enumeration.
*/ */
@ -471,20 +471,20 @@ final class FilesSet {
} }
/** /**
* An interface for file attribute filters that do textual matching. * An interface for file attribute conditions that do textual matching.
*/ */
static interface TextFilter extends FileAttributeCondition { static interface TextCondition extends FileAttributeCondition {
/** /**
* Gets the text the filter matches. * Gets the text the condition matches.
* *
* @return The text. * @return The text.
*/ */
String getTextToMatch(); String getTextToMatch();
/** /**
* Queries whether or not the text the filter matches is a regular * Queries whether or not the text the condition matches is a
* expression. * regular expression.
* *
* @return True if the text to be matched is a regular expression, * @return True if the text to be matched is a regular expression,
* false otherwise. * false otherwise.
@ -492,7 +492,7 @@ final class FilesSet {
boolean isRegex(); boolean isRegex();
/** /**
* Determines whether a string of text matches the filter. * Determines whether a string of text matches the condition.
* *
* @param textToMatch The text string. * @param textToMatch The text string.
* *
@ -503,19 +503,20 @@ final class FilesSet {
} }
/** /**
* An abstract base class for file attribute filters that do textual * An abstract base class for file attribute conditions that do textual
* matching. * matching.
*/ */
private static abstract class AbstractTextFilter implements TextFilter { private static abstract class AbstractTextCondition implements TextCondition {
private static final long serialVersionUID = 1L;
private final TextMatcher textMatcher; private final TextMatcher textMatcher;
/** /**
* Construct a case-insensitive text filter. * Construct a case-insensitive text condition.
* *
* @param text The text to be matched. * @param text The text to be matched.
*/ */
AbstractTextFilter(String text, Boolean partialMatch) { AbstractTextCondition(String text, Boolean partialMatch) {
if (partialMatch) { if (partialMatch) {
this.textMatcher = new FilesSet.Rule.CaseInsensitivePartialStringComparisionMatcher(text); this.textMatcher = new FilesSet.Rule.CaseInsensitivePartialStringComparisionMatcher(text);
} else { } else {
@ -524,16 +525,16 @@ final class FilesSet {
} }
/** /**
* Construct a regular expression text filter. * Construct a regular expression text condition.
* *
* @param regex The regular expression to be matched. * @param regex The regular expression to be matched.
*/ */
AbstractTextFilter(Pattern regex) { AbstractTextCondition(Pattern regex) {
this.textMatcher = new FilesSet.Rule.RegexMatcher(regex); this.textMatcher = new FilesSet.Rule.RegexMatcher(regex);
} }
/** /**
* Get the text the filter matches. * Get the text the condition matches.
* *
* @return The text. * @return The text.
*/ */
@ -543,8 +544,8 @@ final class FilesSet {
} }
/** /**
* Queries whether or not the text the filter matches is a regular * Queries whether or not the text the condition matches is a
* expression. * regular expression.
* *
* @return True if the text to be matched is a regular expression, * @return True if the text to be matched is a regular expression,
* false otherwise. * false otherwise.
@ -555,7 +556,7 @@ final class FilesSet {
} }
/** /**
* Determines whether a string of text matches the filter. * Determines whether a string of text matches the condition.
* *
* @param textToMatch The text string. * @param textToMatch The text string.
* *
@ -575,27 +576,29 @@ final class FilesSet {
} }
/** /**
* A file path filter for an interesting files set membership rule. The * A file path condition for an interesting files set membership rule.
* immutability of a path filter object allows it to be safely published * The immutability of a path condition object allows it to be safely
* to multiple threads. * published to multiple threads.
*/ */
static final class ParentPathFilter extends AbstractTextFilter { static final class ParentPathCondition extends AbstractTextCondition {
private static final long serialVersionUID = 1L;
/** /**
* Construct a case-insensitive file path filter. * Construct a case-insensitive file path condition.
* *
* @param path The path to be matched. * @param path The path to be matched.
*/ */
ParentPathFilter(String path) { ParentPathCondition(String path) {
super(path, true); super(path, true);
} }
/** /**
* Construct a file path regular expression filter. * Construct a file path regular expression condition.
* *
* @param path The path regular expression to be matched. * @param path The path regular expression to be matched.
*/ */
ParentPathFilter(Pattern path) { ParentPathCondition(Pattern path) {
super(path); super(path);
} }
@ -610,34 +613,37 @@ final class FilesSet {
} }
/** /**
* A "tagging" interface to group name and extension filters separately * A "tagging" interface to group name and extension conditions
* from path filters for type safety when constructing rules. * separately from path conditions for type safety when constructing
* rules.
*/ */
static interface FileNameFilter extends TextFilter { static interface FileNameCondition extends TextCondition {
} }
/** /**
* A file name filter for an interesting files set membership rule. The * A file name condition for an interesting files set membership rule.
* immutability of a file name filter object allows it to be safely * The immutability of a file name condition object allows it to be
* published to multiple threads. * safely published to multiple threads.
*/ */
static final class FullNameFilter extends AbstractTextFilter implements FileNameFilter { static final class FullNameCondition extends AbstractTextCondition implements FileNameCondition {
private static final long serialVersionUID = 1L;
/** /**
* Construct a case-insensitive full file name filter. * Construct a case-insensitive full file name condition.
* *
* @param name The file name to be matched. * @param name The file name to be matched.
*/ */
FullNameFilter(String name) { FullNameCondition(String name) {
super(name, false); super(name, false);
} }
/** /**
* Construct a full file name regular expression filter. * Construct a full file name regular expression condition.
* *
* @param name The file name regular expression to be matched. * @param name The file name regular expression to be matched.
*/ */
FullNameFilter(Pattern name) { FullNameCondition(Pattern name) {
super(name); super(name);
} }
@ -652,18 +658,20 @@ final class FilesSet {
} }
/** /**
* A file name extension filter for an interesting files set membership * A file name extension condition for an interesting files set
* rule. The immutability of a file name extension filter object allows * membership rule. The immutability of a file name extension condition
* it to be safely published to multiple threads. * object allows it to be safely published to multiple threads.
*/ */
static final class ExtensionFilter extends AbstractTextFilter implements FileNameFilter { static final class ExtensionCondition extends AbstractTextCondition implements FileNameCondition {
private static final long serialVersionUID = 1L;
/** /**
* Construct a case-insensitive file name extension filter. * Construct a case-insensitive file name extension condition.
* *
* @param extension The file name extension to be matched. * @param extension The file name extension to be matched.
*/ */
ExtensionFilter(String extension) { ExtensionCondition(String extension) {
// If there is a leading ".", strip it since // If there is a leading ".", strip it since
// AbstractFile.getFileNameExtension() returns just the // AbstractFile.getFileNameExtension() returns just the
// extension chars and not the dot. // extension chars and not the dot.
@ -671,12 +679,12 @@ final class FilesSet {
} }
/** /**
* Construct a file name extension regular expression filter. * Construct a file name extension regular expression condition.
* *
* @param extension The file name extension regular expression to be * @param extension The file name extension regular expression to be
* matched. * matched.
*/ */
ExtensionFilter(Pattern extension) { ExtensionCondition(Pattern extension) {
super(extension.pattern(), false); super(extension.pattern(), false);
} }
@ -692,7 +700,7 @@ final class FilesSet {
/** /**
* An interface for objects that do textual matches, used to compose a * An interface for objects that do textual matches, used to compose a
* text filter. * text condition.
*/ */
private static interface TextMatcher { private static interface TextMatcher {

View File

@ -71,9 +71,9 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
FilesSetRulePanel(FilesSet.Rule rule) { FilesSetRulePanel(FilesSet.Rule rule) {
initComponents(); initComponents();
populateRuleNameComponent(rule); populateRuleNameComponent(rule);
populateTypeFilterComponents(rule); populateTypeConditionComponents(rule);
populateNameFilterComponents(rule); populateNameConditionComponents(rule);
populatePathFilterComponents(rule); populatePathConditionComponents(rule);
customInit(); customInit();
} }
@ -131,9 +131,9 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
* *
* @param rule The files set rule to be edited. * @param rule The files set rule to be edited.
*/ */
private void populateTypeFilterComponents(FilesSet.Rule rule) { private void populateTypeConditionComponents(FilesSet.Rule rule) {
FilesSet.Rule.MetaTypeCondition typeFilter = rule.getMetaTypeFilter(); FilesSet.Rule.MetaTypeCondition typeCondition = rule.getMetaTypeCondition();
switch (typeFilter.getMetaType()) { switch (typeCondition.getMetaType()) {
case FILES: case FILES:
this.filesRadioButton.setSelected(true); this.filesRadioButton.setSelected(true);
break; break;
@ -151,11 +151,11 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
* *
* @param rule The files set rule to be edited. * @param rule The files set rule to be edited.
*/ */
private void populateNameFilterComponents(FilesSet.Rule rule) { private void populateNameConditionComponents(FilesSet.Rule rule) {
FilesSet.Rule.FileNameFilter nameFilter = rule.getFileNameFilter(); FilesSet.Rule.FileNameCondition nameCondition = rule.getFileNameCondition();
this.nameTextField.setText(nameFilter.getTextToMatch()); this.nameTextField.setText(nameCondition.getTextToMatch());
this.nameRegexCheckbox.setSelected(nameFilter.isRegex()); this.nameRegexCheckbox.setSelected(nameCondition.isRegex());
if (nameFilter instanceof FilesSet.Rule.FullNameFilter) { if (nameCondition instanceof FilesSet.Rule.FullNameCondition) {
this.fullNameRadioButton.setSelected(true); this.fullNameRadioButton.setSelected(true);
} else { } else {
this.extensionRadioButton.setSelected(true); this.extensionRadioButton.setSelected(true);
@ -168,11 +168,11 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
* *
* @param rule The files set rule to be edited. * @param rule The files set rule to be edited.
*/ */
private void populatePathFilterComponents(FilesSet.Rule rule) { private void populatePathConditionComponents(FilesSet.Rule rule) {
FilesSet.Rule.ParentPathFilter pathFilter = rule.getPathFilter(); FilesSet.Rule.ParentPathCondition pathCondition = rule.getPathCondition();
if (pathFilter != null) { if (pathCondition != null) {
this.pathTextField.setText(pathFilter.getTextToMatch()); this.pathTextField.setText(pathCondition.getTextToMatch());
this.pathRegexCheckBox.setSelected(pathFilter.isRegex()); this.pathRegexCheckBox.setSelected(pathCondition.isRegex());
} }
} }
@ -188,7 +188,7 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
// The rule must have name condition text. // The rule must have name condition text.
if (this.nameTextField.getText().isEmpty()) { if (this.nameTextField.getText().isEmpty()) {
NotifyDescriptor notifyDesc = new NotifyDescriptor.Message( NotifyDescriptor notifyDesc = new NotifyDescriptor.Message(
NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.emptyNameFilter"), NbBundle.getMessage(FilesSetPanel.class, "FilesSetRulePanel.messages.emptyNameCondition"),
NotifyDescriptor.WARNING_MESSAGE); NotifyDescriptor.WARNING_MESSAGE);
DialogDisplayer.getDefault().notify(notifyDesc); DialogDisplayer.getDefault().notify(notifyDesc);
return false; return false;
@ -260,35 +260,35 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
* *
* @throws IllegalStateException if the specified name condition is not valid. * @throws IllegalStateException if the specified name condition is not valid.
*/ */
FilesSet.Rule.FileNameFilter getFileNameFilter() throws IllegalStateException { FilesSet.Rule.FileNameCondition getFileNameCondition() throws IllegalStateException {
FilesSet.Rule.FileNameFilter filter = null; FilesSet.Rule.FileNameCondition condition = null;
if (!this.nameTextField.getText().isEmpty()) { if (!this.nameTextField.getText().isEmpty()) {
if (this.nameRegexCheckbox.isSelected()) { if (this.nameRegexCheckbox.isSelected()) {
try { try {
Pattern pattern = Pattern.compile(this.nameTextField.getText()); Pattern pattern = Pattern.compile(this.nameTextField.getText());
if (this.fullNameRadioButton.isSelected()) { if (this.fullNameRadioButton.isSelected()) {
filter = new FilesSet.Rule.FullNameFilter(pattern); condition = new FilesSet.Rule.FullNameCondition(pattern);
} else { } else {
filter = new FilesSet.Rule.ExtensionFilter(pattern); condition = new FilesSet.Rule.ExtensionCondition(pattern);
} }
} catch (PatternSyntaxException ex) { } catch (PatternSyntaxException ex) {
logger.log(Level.SEVERE, "Attempt to get regex name filter that does not compile", ex); // NON-NLS logger.log(Level.SEVERE, "Attempt to get regex name condition that does not compile", ex); // NON-NLS
throw new IllegalStateException("The files set rule panel name filter is not in a valid state"); // NON-NLS throw new IllegalStateException("The files set rule panel name condition is not in a valid state"); // NON-NLS
} }
} else { } else {
if (FilesSetRulePanel.containsOnlyLegalChars(this.nameTextField.getText(), FilesSetRulePanel.ILLEGAL_FILE_NAME_CHARS)) { if (FilesSetRulePanel.containsOnlyLegalChars(this.nameTextField.getText(), FilesSetRulePanel.ILLEGAL_FILE_NAME_CHARS)) {
if (this.fullNameRadioButton.isSelected()) { if (this.fullNameRadioButton.isSelected()) {
filter = new FilesSet.Rule.FullNameFilter(this.nameTextField.getText()); condition = new FilesSet.Rule.FullNameCondition(this.nameTextField.getText());
} else { } else {
filter = new FilesSet.Rule.ExtensionFilter(this.nameTextField.getText()); condition = new FilesSet.Rule.ExtensionCondition(this.nameTextField.getText());
} }
} else { } else {
logger.log(Level.SEVERE, "Attempt to get name filter with illegal chars"); // NON-NLS logger.log(Level.SEVERE, "Attempt to get name condition with illegal chars"); // NON-NLS
throw new IllegalStateException("The files set rule panel name filter is not in a valid state"); // NON-NLS throw new IllegalStateException("The files set rule panel name condition is not in a valid state"); // NON-NLS
} }
} }
} }
return filter; return condition;
} }
/** /**
@ -329,7 +329,7 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
* *
* @return A type condition. * @return A type condition.
*/ */
FilesSet.Rule.MetaTypeCondition getMetaTypeFilter() { FilesSet.Rule.MetaTypeCondition getMetaTypeCondition() {
if (this.filesRadioButton.isSelected()) { if (this.filesRadioButton.isSelected()) {
return new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.FILES); return new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.FILES);
} else if (this.dirsRadioButton.isSelected()) { } else if (this.dirsRadioButton.isSelected()) {
@ -347,15 +347,15 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
* *
* @throws IllegalStateException if the specified path condition is not valid. * @throws IllegalStateException if the specified path condition is not valid.
*/ */
FilesSet.Rule.ParentPathFilter getPathFilter() throws IllegalStateException { FilesSet.Rule.ParentPathCondition getPathCondition() throws IllegalStateException {
FilesSet.Rule.ParentPathFilter filter = null; FilesSet.Rule.ParentPathCondition condition = null;
if (!this.pathTextField.getText().isEmpty()) { if (!this.pathTextField.getText().isEmpty()) {
if (this.pathRegexCheckBox.isSelected()) { if (this.pathRegexCheckBox.isSelected()) {
try { try {
filter = new FilesSet.Rule.ParentPathFilter(Pattern.compile(this.pathTextField.getText())); condition = new FilesSet.Rule.ParentPathCondition(Pattern.compile(this.pathTextField.getText()));
} catch (PatternSyntaxException ex) { } catch (PatternSyntaxException ex) {
logger.log(Level.SEVERE, "Attempt to get malformed path filter", ex); // NON-NLS logger.log(Level.SEVERE, "Attempt to get malformed path condition", ex); // NON-NLS
throw new IllegalStateException("The files set rule panel path filter is not in a valid state"); // NON-NLS throw new IllegalStateException("The files set rule panel path condition is not in a valid state"); // NON-NLS
} }
} else { } else {
String path = this.pathTextField.getText(); String path = this.pathTextField.getText();
@ -368,14 +368,14 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
if (!path.endsWith(FilesSetRulePanel.SLEUTHKIT_PATH_SEPARATOR)) { if (!path.endsWith(FilesSetRulePanel.SLEUTHKIT_PATH_SEPARATOR)) {
path += FilesSetRulePanel.SLEUTHKIT_PATH_SEPARATOR; path += FilesSetRulePanel.SLEUTHKIT_PATH_SEPARATOR;
} }
filter = new FilesSet.Rule.ParentPathFilter(path); condition = new FilesSet.Rule.ParentPathCondition(path);
} else { } else {
logger.log(Level.SEVERE, "Attempt to get path filter with illegal chars"); // NON-NLS logger.log(Level.SEVERE, "Attempt to get path condition with illegal chars"); // NON-NLS
throw new IllegalStateException("The files set rule panel path filter is not in a valid state"); // NON-NLS throw new IllegalStateException("The files set rule panel path condition is not in a valid state"); // NON-NLS
} }
} }
} }
return filter; return condition;
} }
/** /**

View File

@ -140,11 +140,11 @@ final class InterestingItemDefsManager extends Observable {
// to allow Autopsy to use TSK Framework interesting files set // to allow Autopsy to use TSK Framework interesting files set
// definitions. // definitions.
// 2. The TSK Framework has an interesting files module that supports // 2. The TSK Framework has an interesting files module that supports
// simple globbing with "*" characters. Name rules and path filters with // simple globbing with "*" characters. Name rules and path conditions with
// "*" characters will be converted to regexes to allow Autopsy to use // "*" characters will be converted to regexes to allow Autopsy to use
// TSK Framework interesting files set definitions. // TSK Framework interesting files set definitions.
// 3. Type filters are required by Autopsy, but not by TSK Frmaework. // 3. Type conditions are required by Autopsy, but not by TSK Frmaework.
// Missing type filters will defualt to "files" filters. // Missing type conditions will defualt to "files" conditions.
private static final String REGEX_ATTR = "regex"; //NON-NLS private static final String REGEX_ATTR = "regex"; //NON-NLS
private static final String PATH_REGEX_ATTR = "pathRegex"; //NON-NLS private static final String PATH_REGEX_ATTR = "pathRegex"; //NON-NLS
private static final String TYPE_FILTER_VALUE_FILES_AND_DIRS = "files_and_dirs"; //NON-NLS private static final String TYPE_FILTER_VALUE_FILES_AND_DIRS = "files_and_dirs"; //NON-NLS
@ -288,16 +288,16 @@ final class InterestingItemDefsManager extends Observable {
private static FilesSet.Rule readFileNameRule(Element elem) { private static FilesSet.Rule readFileNameRule(Element elem) {
String ruleName = FilesSetXML.readRuleName(elem); String ruleName = FilesSetXML.readRuleName(elem);
// The content of the rule tag is a file name filter. It may be a // The content of the rule tag is a file name condition. It may be a
// regex, or it may be from a TSK Framework rule definition with a // regex, or it may be from a TSK Framework rule definition with a
// "*" globbing char, or it may be simple text. // "*" globbing char, or it may be simple text.
String content = elem.getTextContent(); String content = elem.getTextContent();
FilesSet.Rule.FullNameFilter nameFilter; FilesSet.Rule.FullNameCondition namecondition;
String regex = elem.getAttribute(FilesSetXML.REGEX_ATTR); String regex = elem.getAttribute(FilesSetXML.REGEX_ATTR);
if ((!regex.isEmpty() && regex.equalsIgnoreCase("true")) || content.contains("*")) { // NON-NLS if ((!regex.isEmpty() && regex.equalsIgnoreCase("true")) || content.contains("*")) { // NON-NLS
Pattern pattern = compileRegex(content); Pattern pattern = compileRegex(content);
if (pattern != null) { if (pattern != null) {
nameFilter = new FilesSet.Rule.FullNameFilter(pattern); namecondition = new FilesSet.Rule.FullNameCondition(pattern);
} else { } else {
logger.log(Level.SEVERE, "Error compiling " + FilesSetXML.NAME_RULE_TAG + " regex, ignoring malformed '{0}' rule definition", ruleName); // NON-NLS logger.log(Level.SEVERE, "Error compiling " + FilesSetXML.NAME_RULE_TAG + " regex, ignoring malformed '{0}' rule definition", ruleName); // NON-NLS
return null; return null;
@ -309,29 +309,29 @@ final class InterestingItemDefsManager extends Observable {
return null; return null;
} }
} }
nameFilter = new FilesSet.Rule.FullNameFilter(content); namecondition = new FilesSet.Rule.FullNameCondition(content);
} }
// Read in the type filter. // Read in the type condition.
FilesSet.Rule.MetaTypeCondition metaTypeFilter = FilesSetXML.readMetaTypeFilter(elem); FilesSet.Rule.MetaTypeCondition metaTypecondition = FilesSetXML.readMetaTypecondition(elem);
if (metaTypeFilter == null) { if (metaTypecondition == null) {
// Malformed attribute. // Malformed attribute.
return null; return null;
} }
// Read in the optional path filter. Null is o.k., but if the attribute // Read in the optional path condition. Null is o.k., but if the attribute
// is there, be sure it is not malformed. // is there, be sure it is not malformed.
FilesSet.Rule.ParentPathFilter pathFilter = null; FilesSet.Rule.ParentPathCondition pathcondition = null;
if (!elem.getAttribute(FilesSetXML.PATH_FILTER_ATTR).isEmpty() if (!elem.getAttribute(FilesSetXML.PATH_FILTER_ATTR).isEmpty()
|| !elem.getAttribute(FilesSetXML.PATH_REGEX_ATTR).isEmpty()) { || !elem.getAttribute(FilesSetXML.PATH_REGEX_ATTR).isEmpty()) {
pathFilter = FilesSetXML.readPathFilter(elem); pathcondition = FilesSetXML.readPathcondition(elem);
if (pathFilter == null) { if (pathcondition == null) {
// Malformed attribute. // Malformed attribute.
return null; return null;
} }
} }
return new FilesSet.Rule(ruleName, nameFilter, metaTypeFilter, pathFilter, null, null); return new FilesSet.Rule(ruleName, namecondition, metaTypecondition, pathcondition, null, null);
} }
/** /**
@ -346,16 +346,16 @@ final class InterestingItemDefsManager extends Observable {
private static FilesSet.Rule readFileExtensionRule(Element elem) { private static FilesSet.Rule readFileExtensionRule(Element elem) {
String ruleName = FilesSetXML.readRuleName(elem); String ruleName = FilesSetXML.readRuleName(elem);
// The content of the rule tag is a file name extension filter. It may // The content of the rule tag is a file name extension condition. It may
// be a regex, or it may be from a TSK Framework rule definition // be a regex, or it may be from a TSK Framework rule definition
// with a "*" globbing char. // with a "*" globbing char.
String content = elem.getTextContent(); String content = elem.getTextContent();
FilesSet.Rule.ExtensionFilter extFilter; FilesSet.Rule.ExtensionCondition extcondition;
String regex = elem.getAttribute(FilesSetXML.REGEX_ATTR); String regex = elem.getAttribute(FilesSetXML.REGEX_ATTR);
if ((!regex.isEmpty() && regex.equalsIgnoreCase("true")) || content.contains("*")) { // NON-NLS if ((!regex.isEmpty() && regex.equalsIgnoreCase("true")) || content.contains("*")) { // NON-NLS
Pattern pattern = compileRegex(content); Pattern pattern = compileRegex(content);
if (pattern != null) { if (pattern != null) {
extFilter = new FilesSet.Rule.ExtensionFilter(pattern); extcondition = new FilesSet.Rule.ExtensionCondition(pattern);
} else { } else {
logger.log(Level.SEVERE, "Error compiling " + FilesSetXML.EXTENSION_RULE_TAG + " regex, ignoring malformed {0} rule definition", ruleName); // NON-NLS logger.log(Level.SEVERE, "Error compiling " + FilesSetXML.EXTENSION_RULE_TAG + " regex, ignoring malformed {0} rule definition", ruleName); // NON-NLS
return null; return null;
@ -367,35 +367,35 @@ final class InterestingItemDefsManager extends Observable {
return null; return null;
} }
} }
extFilter = new FilesSet.Rule.ExtensionFilter(content); extcondition = new FilesSet.Rule.ExtensionCondition(content);
} }
// The rule must have a meta-type filter, unless a TSK Framework // The rule must have a meta-type condition, unless a TSK Framework
// definitions file is being read. // definitions file is being read.
FilesSet.Rule.MetaTypeCondition metaTypeFilter = null; FilesSet.Rule.MetaTypeCondition metaTypecondition = null;
if (!elem.getAttribute(FilesSetXML.TYPE_FILTER_ATTR).isEmpty()) { if (!elem.getAttribute(FilesSetXML.TYPE_FILTER_ATTR).isEmpty()) {
metaTypeFilter = FilesSetXML.readMetaTypeFilter(elem); metaTypecondition = FilesSetXML.readMetaTypecondition(elem);
if (metaTypeFilter == null) { if (metaTypecondition == null) {
// Malformed attribute. // Malformed attribute.
return null; return null;
} }
} else { } else {
metaTypeFilter = new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.FILES); metaTypecondition = new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.FILES);
} }
// The rule may have a path filter. Null is o.k., but if the attribute // The rule may have a path condition. Null is o.k., but if the attribute
// is there, it must not be malformed. // is there, it must not be malformed.
FilesSet.Rule.ParentPathFilter pathFilter = null; FilesSet.Rule.ParentPathCondition pathcondition = null;
if (!elem.getAttribute(FilesSetXML.PATH_FILTER_ATTR).isEmpty() if (!elem.getAttribute(FilesSetXML.PATH_FILTER_ATTR).isEmpty()
|| !elem.getAttribute(FilesSetXML.PATH_REGEX_ATTR).isEmpty()) { || !elem.getAttribute(FilesSetXML.PATH_REGEX_ATTR).isEmpty()) {
pathFilter = FilesSetXML.readPathFilter(elem); pathcondition = FilesSetXML.readPathcondition(elem);
if (pathFilter == null) { if (pathcondition == null) {
// Malformed attribute. // Malformed attribute.
return null; return null;
} }
} }
return new FilesSet.Rule(ruleName, extFilter, metaTypeFilter, pathFilter, null, null); return new FilesSet.Rule(ruleName, extcondition, metaTypecondition, pathcondition, null, null);
} }
/** /**
@ -428,62 +428,62 @@ final class InterestingItemDefsManager extends Observable {
} }
/** /**
* Construct a meta-type filter for an interesting files set membership * Construct a meta-type condition for an interesting files set membership
* rule from data in an XML element. * rule from data in an XML element.
* *
* @param ruleElement The XML element. * @param ruleElement The XML element.
* *
* @return The meta-type filter, or null if there is an error (logged). * @return The meta-type condition, or null if there is an error (logged).
*/ */
private static FilesSet.Rule.MetaTypeCondition readMetaTypeFilter(Element ruleElement) { private static FilesSet.Rule.MetaTypeCondition readMetaTypecondition(Element ruleElement) {
FilesSet.Rule.MetaTypeCondition filter = null; FilesSet.Rule.MetaTypeCondition condition = null;
String filterAttribute = ruleElement.getAttribute(FilesSetXML.TYPE_FILTER_ATTR); String conditionAttribute = ruleElement.getAttribute(FilesSetXML.TYPE_FILTER_ATTR);
if (!filterAttribute.isEmpty()) { if (!conditionAttribute.isEmpty()) {
switch (filterAttribute) { switch (conditionAttribute) {
case FilesSetXML.TYPE_FILTER_VALUE_FILES: case FilesSetXML.TYPE_FILTER_VALUE_FILES:
filter = new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.FILES); condition = new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.FILES);
break; break;
case FilesSetXML.TYPE_FILTER_VALUE_DIRS: case FilesSetXML.TYPE_FILTER_VALUE_DIRS:
filter = new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.DIRECTORIES); condition = new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.DIRECTORIES);
break; break;
case FilesSetXML.TYPE_FILTER_VALUE_FILES_AND_DIRS: case FilesSetXML.TYPE_FILTER_VALUE_FILES_AND_DIRS:
filter = new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.FILES_AND_DIRECTORIES); condition = new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.FILES_AND_DIRECTORIES);
break; break;
default: default:
logger.log(Level.SEVERE, "Found {0} " + FilesSetXML.TYPE_FILTER_ATTR + " attribute with unrecognized value ''{0}'', ignoring malformed rule definition", filterAttribute); // NON-NLS logger.log(Level.SEVERE, "Found {0} " + FilesSetXML.TYPE_FILTER_ATTR + " attribute with unrecognized value ''{0}'', ignoring malformed rule definition", conditionAttribute); // NON-NLS
break; break;
} }
} else { } else {
// Accept TSK Framework interesting files set definitions, // Accept TSK Framework interesting files set definitions,
// default to files. // default to files.
filter = new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.FILES); condition = new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.FILES);
} }
return filter; return condition;
} }
/** /**
* Construct a path filter for an interesting files set membership rule * Construct a path condition for an interesting files set membership rule
* from data in an XML element. * from data in an XML element.
* *
* @param ruleElement The XML element. * @param ruleElement The XML element.
* *
* @return The path filter, or null if there is an error (logged). * @return The path condition, or null if there is an error (logged).
*/ */
private static FilesSet.Rule.ParentPathFilter readPathFilter(Element ruleElement) { private static FilesSet.Rule.ParentPathCondition readPathcondition(Element ruleElement) {
FilesSet.Rule.ParentPathFilter filter = null; FilesSet.Rule.ParentPathCondition condition = null;
String path = ruleElement.getAttribute(FilesSetXML.PATH_FILTER_ATTR); String path = ruleElement.getAttribute(FilesSetXML.PATH_FILTER_ATTR);
String pathRegex = ruleElement.getAttribute(FilesSetXML.PATH_REGEX_ATTR); String pathRegex = ruleElement.getAttribute(FilesSetXML.PATH_REGEX_ATTR);
if (!pathRegex.isEmpty() && path.isEmpty()) { if (!pathRegex.isEmpty() && path.isEmpty()) {
try { try {
Pattern pattern = Pattern.compile(pathRegex); Pattern pattern = Pattern.compile(pathRegex);
filter = new FilesSet.Rule.ParentPathFilter(pattern); condition = new FilesSet.Rule.ParentPathCondition(pattern);
} catch (PatternSyntaxException ex) { } catch (PatternSyntaxException ex) {
logger.log(Level.SEVERE, "Error compiling " + FilesSetXML.PATH_REGEX_ATTR + " regex, ignoring malformed path filter definition", ex); // NON-NLS logger.log(Level.SEVERE, "Error compiling " + FilesSetXML.PATH_REGEX_ATTR + " regex, ignoring malformed path condition definition", ex); // NON-NLS
} }
} else if (!path.isEmpty() && pathRegex.isEmpty()) { } else if (!path.isEmpty() && pathRegex.isEmpty()) {
filter = new FilesSet.Rule.ParentPathFilter(path); condition = new FilesSet.Rule.ParentPathCondition(path);
} }
return filter; return condition;
} }
/** /**
@ -517,11 +517,11 @@ final class InterestingItemDefsManager extends Observable {
// Add the child elements for the set membership rules. // Add the child elements for the set membership rules.
for (FilesSet.Rule rule : set.getRules().values()) { for (FilesSet.Rule rule : set.getRules().values()) {
// Add a rule element with the appropriate name filter // Add a rule element with the appropriate name condition
// type tag. // type tag.
FilesSet.Rule.FileNameFilter nameFilter = rule.getFileNameFilter(); FilesSet.Rule.FileNameCondition namecondition = rule.getFileNameCondition();
Element ruleElement; Element ruleElement;
if (nameFilter instanceof FilesSet.Rule.FullNameFilter) { if (namecondition instanceof FilesSet.Rule.FullNameCondition) {
ruleElement = doc.createElement(FilesSetXML.NAME_RULE_TAG); ruleElement = doc.createElement(FilesSetXML.NAME_RULE_TAG);
} else { } else {
ruleElement = doc.createElement(FilesSetXML.EXTENSION_RULE_TAG); ruleElement = doc.createElement(FilesSetXML.EXTENSION_RULE_TAG);
@ -530,12 +530,12 @@ final class InterestingItemDefsManager extends Observable {
// Add the rule name attribute. // Add the rule name attribute.
ruleElement.setAttribute(FilesSetXML.NAME_ATTR, rule.getName()); ruleElement.setAttribute(FilesSetXML.NAME_ATTR, rule.getName());
// Add the name filter regex attribute // Add the name condition regex attribute
ruleElement.setAttribute(FilesSetXML.REGEX_ATTR, Boolean.toString(nameFilter.isRegex())); ruleElement.setAttribute(FilesSetXML.REGEX_ATTR, Boolean.toString(namecondition.isRegex()));
// Add the type filter attribute. // Add the type condition attribute.
FilesSet.Rule.MetaTypeCondition typeFilter = rule.getMetaTypeFilter(); FilesSet.Rule.MetaTypeCondition typecondition = rule.getMetaTypeCondition();
switch (typeFilter.getMetaType()) { switch (typecondition.getMetaType()) {
case FILES: case FILES:
ruleElement.setAttribute(FilesSetXML.TYPE_FILTER_ATTR, FilesSetXML.TYPE_FILTER_VALUE_FILES); ruleElement.setAttribute(FilesSetXML.TYPE_FILTER_ATTR, FilesSetXML.TYPE_FILTER_VALUE_FILES);
break; break;
@ -547,18 +547,18 @@ final class InterestingItemDefsManager extends Observable {
break; break;
} }
// Add the optional path filter. // Add the optional path condition.
FilesSet.Rule.ParentPathFilter pathFilter = rule.getPathFilter(); FilesSet.Rule.ParentPathCondition pathcondition = rule.getPathCondition();
if (pathFilter != null) { if (pathcondition != null) {
if (pathFilter.isRegex()) { if (pathcondition.isRegex()) {
ruleElement.setAttribute(FilesSetXML.PATH_REGEX_ATTR, pathFilter.getTextToMatch()); ruleElement.setAttribute(FilesSetXML.PATH_REGEX_ATTR, pathcondition.getTextToMatch());
} else { } else {
ruleElement.setAttribute(FilesSetXML.PATH_FILTER_ATTR, pathFilter.getTextToMatch()); ruleElement.setAttribute(FilesSetXML.PATH_FILTER_ATTR, pathcondition.getTextToMatch());
} }
} }
// Add the name filter text as the rule element content. // Add the name condition text as the rule element content.
ruleElement.setTextContent(nameFilter.getTextToMatch()); ruleElement.setTextContent(namecondition.getTextToMatch());
setElement.appendChild(ruleElement); setElement.appendChild(ruleElement);
} }

View File

@ -113,7 +113,7 @@
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="fileNameRegexCheckbox" min="-2" max="-2" attributes="0"/> <Component id="fileNameRegexCheckbox" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<Component id="rulePathFilterRegexCheckBox" alignment="0" min="-2" max="-2" attributes="0"/> <Component id="rulePathConditionRegexCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
<Group type="102" attributes="0"> <Group type="102" attributes="0">
@ -125,7 +125,7 @@
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0"> <Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="rulePathFilterTextField" linkSize="4" alignment="0" min="-2" pref="250" max="-2" attributes="0"/> <Component id="rulePathConditionTextField" linkSize="4" alignment="0" min="-2" pref="250" max="-2" attributes="0"/>
<Component id="mimeTypeComboBox" linkSize="4" alignment="0" min="-2" pref="248" max="-2" attributes="0"/> <Component id="mimeTypeComboBox" linkSize="4" alignment="0" min="-2" pref="248" max="-2" attributes="0"/>
<Component id="fileNameTextField" linkSize="4" alignment="0" min="-2" pref="244" max="-2" attributes="0"/> <Component id="fileNameTextField" linkSize="4" alignment="0" min="-2" pref="244" max="-2" attributes="0"/>
<Group type="102" attributes="0"> <Group type="102" attributes="0">
@ -224,10 +224,10 @@
<EmptySpace type="unrelated" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0"> <Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="rulePathFilterTextField" alignment="3" min="-2" pref="20" max="-2" attributes="0"/> <Component id="rulePathConditionTextField" alignment="3" min="-2" pref="20" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="rulePathFilterRegexCheckBox" min="-2" max="-2" attributes="0"/> <Component id="rulePathConditionRegexCheckBox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0"> <Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
@ -518,16 +518,16 @@
<Property name="enabled" type="boolean" value="false"/> <Property name="enabled" type="boolean" value="false"/>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JTextField" name="rulePathFilterTextField"> <Component class="javax.swing.JTextField" name="rulePathConditionTextField">
<Properties> <Properties>
<Property name="editable" type="boolean" value="false"/> <Property name="editable" type="boolean" value="false"/>
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor">
<FontInfo relative="true"> <FontInfo relative="true">
<Font bold="false" component="rulePathFilterTextField" property="font" relativeSize="false" size="11"/> <Font bold="false" component="rulePathConditionTextField" property="font" relativeSize="false" size="11"/>
</FontInfo> </FontInfo>
</Property> </Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/modules/interestingitems/Bundle.properties" key="InterestingItemDefsPanel.rulePathFilterTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/modules/interestingitems/Bundle.properties" key="InterestingItemDefsPanel.rulePathConditionTextField.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
@ -698,15 +698,15 @@
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JCheckBox" name="rulePathFilterRegexCheckBox"> <Component class="javax.swing.JCheckBox" name="rulePathConditionRegexCheckBox">
<Properties> <Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor"> <Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor">
<FontInfo relative="true"> <FontInfo relative="true">
<Font bold="false" component="rulePathFilterRegexCheckBox" property="font" relativeSize="false" size="11"/> <Font bold="false" component="rulePathConditionRegexCheckBox" property="font" relativeSize="false" size="11"/>
</FontInfo> </FontInfo>
</Property> </Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/modules/interestingitems/Bundle.properties" key="InterestingItemDefsPanel.rulePathFilterRegexCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/modules/interestingitems/Bundle.properties" key="InterestingItemDefsPanel.rulePathConditionRegexCheckBox.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
<Property name="enabled" type="boolean" value="false"/> <Property name="enabled" type="boolean" value="false"/>
</Properties> </Properties>

View File

@ -177,8 +177,8 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp
this.fileNameRadioButton.setSelected(true); this.fileNameRadioButton.setSelected(true);
this.fileNameRegexCheckbox.setSelected(false); this.fileNameRegexCheckbox.setSelected(false);
this.filesRadioButton.setSelected(true); this.filesRadioButton.setSelected(true);
this.rulePathFilterTextField.setText(""); this.rulePathConditionTextField.setText("");
this.rulePathFilterRegexCheckBox.setSelected(false); this.rulePathConditionRegexCheckBox.setSelected(false);
this.newRuleButton.setEnabled(!this.setsListModel.isEmpty()); this.newRuleButton.setEnabled(!this.setsListModel.isEmpty());
this.editRuleButton.setEnabled(false); this.editRuleButton.setEnabled(false);
this.deleteRuleButton.setEnabled(false); this.deleteRuleButton.setEnabled(false);
@ -242,19 +242,19 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp
// Get the selected rule and populate the rule components. // Get the selected rule and populate the rule components.
FilesSet.Rule rule = InterestingItemDefsPanel.this.rulesList.getSelectedValue(); FilesSet.Rule rule = InterestingItemDefsPanel.this.rulesList.getSelectedValue();
if (rule != null) { if (rule != null) {
// Get the filters that make up the rule. // Get the conditions that make up the rule.
FilesSet.Rule.FileNameFilter nameFilter = rule.getFileNameFilter(); FilesSet.Rule.FileNameCondition nameCondition = rule.getFileNameCondition();
FilesSet.Rule.MetaTypeCondition typeFilter = rule.getMetaTypeFilter(); FilesSet.Rule.MetaTypeCondition typeCondition = rule.getMetaTypeCondition();
FilesSet.Rule.ParentPathFilter pathFilter = rule.getPathFilter(); FilesSet.Rule.ParentPathCondition pathCondition = rule.getPathCondition();
FilesSet.Rule.MimeTypeCondition mimeTypeFilter = rule.getMimeTypeFilter(); FilesSet.Rule.MimeTypeCondition mimeTypeCondition = rule.getMimeTypeCondition();
// Populate the components that display the properties of the // Populate the components that display the properties of the
// selected rule. // selected rule.
InterestingItemDefsPanel.this.fileNameTextField.setText(nameFilter.getTextToMatch()); InterestingItemDefsPanel.this.fileNameTextField.setText(nameCondition.getTextToMatch());
InterestingItemDefsPanel.this.fileNameRadioButton.setSelected(nameFilter instanceof FilesSet.Rule.FullNameFilter); InterestingItemDefsPanel.this.fileNameRadioButton.setSelected(nameCondition instanceof FilesSet.Rule.FullNameCondition);
InterestingItemDefsPanel.this.fileNameExtensionRadioButton.setSelected(nameFilter instanceof FilesSet.Rule.ExtensionFilter); InterestingItemDefsPanel.this.fileNameExtensionRadioButton.setSelected(nameCondition instanceof FilesSet.Rule.ExtensionCondition);
InterestingItemDefsPanel.this.fileNameRegexCheckbox.setSelected(nameFilter.isRegex()); InterestingItemDefsPanel.this.fileNameRegexCheckbox.setSelected(nameCondition.isRegex());
switch (typeFilter.getMetaType()) { switch (typeCondition.getMetaType()) {
case FILES: case FILES:
InterestingItemDefsPanel.this.filesRadioButton.setSelected(true); InterestingItemDefsPanel.this.filesRadioButton.setSelected(true);
break; break;
@ -265,14 +265,14 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp
InterestingItemDefsPanel.this.bothRadioButton.setSelected(true); InterestingItemDefsPanel.this.bothRadioButton.setSelected(true);
break; break;
} }
if (pathFilter != null) { if (pathCondition != null) {
InterestingItemDefsPanel.this.rulePathFilterTextField.setText(pathFilter.getTextToMatch()); InterestingItemDefsPanel.this.rulePathConditionTextField.setText(pathCondition.getTextToMatch());
InterestingItemDefsPanel.this.rulePathFilterRegexCheckBox.setSelected(pathFilter.isRegex()); InterestingItemDefsPanel.this.rulePathConditionRegexCheckBox.setSelected(pathCondition.isRegex());
} else { } else {
InterestingItemDefsPanel.this.rulePathFilterTextField.setText(""); InterestingItemDefsPanel.this.rulePathConditionTextField.setText("");
InterestingItemDefsPanel.this.rulePathFilterRegexCheckBox.setSelected(false); InterestingItemDefsPanel.this.rulePathConditionRegexCheckBox.setSelected(false);
} }
InterestingItemDefsPanel.this.mimeTypeComboBox.setSelectedItem(mimeTypeFilter.getMimeType()); InterestingItemDefsPanel.this.mimeTypeComboBox.setSelectedItem(mimeTypeCondition.getMimeType());
// Enable the new, edit and delete rule buttons. // Enable the new, edit and delete rule buttons.
InterestingItemDefsPanel.this.newRuleButton.setEnabled(true); InterestingItemDefsPanel.this.newRuleButton.setEnabled(true);
@ -371,7 +371,7 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp
if (selectedRule != null) { if (selectedRule != null) {
rules.remove(selectedRule.getUuid()); rules.remove(selectedRule.getUuid());
} }
FilesSet.Rule newRule = new FilesSet.Rule(panel.getRuleName(), panel.getFileNameFilter(), panel.getMetaTypeFilter(), panel.getPathFilter(), panel.getMimeTypeCondition(), panel.getFileSizeCondition()); FilesSet.Rule newRule = new FilesSet.Rule(panel.getRuleName(), panel.getFileNameCondition(), panel.getMetaTypeCondition(), panel.getPathCondition(), panel.getMimeTypeCondition(), panel.getFileSizeCondition());
rules.put(newRule.getUuid(), newRule); rules.put(newRule.getUuid(), newRule);
// Add the new/edited files set definition, replacing any previous // Add the new/edited files set definition, replacing any previous
@ -454,7 +454,7 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp
fileNameTextField = new javax.swing.JTextField(); fileNameTextField = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel();
fileNameRadioButton = new javax.swing.JRadioButton(); fileNameRadioButton = new javax.swing.JRadioButton();
rulePathFilterTextField = new javax.swing.JTextField(); rulePathConditionTextField = new javax.swing.JTextField();
ignoreKnownFilesCheckbox = new javax.swing.JCheckBox(); ignoreKnownFilesCheckbox = new javax.swing.JCheckBox();
fileNameRegexCheckbox = new javax.swing.JCheckBox(); fileNameRegexCheckbox = new javax.swing.JCheckBox();
separator = new javax.swing.JSeparator(); separator = new javax.swing.JSeparator();
@ -467,7 +467,7 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp
dirsRadioButton = new javax.swing.JRadioButton(); dirsRadioButton = new javax.swing.JRadioButton();
jLabel1 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel();
rulePathFilterRegexCheckBox = new javax.swing.JCheckBox(); rulePathConditionRegexCheckBox = new javax.swing.JCheckBox();
jScrollPane2 = new javax.swing.JScrollPane(); jScrollPane2 = new javax.swing.JScrollPane();
jTextArea1 = new javax.swing.JTextArea(); jTextArea1 = new javax.swing.JTextArea();
jLabel7 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel();
@ -566,9 +566,9 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp
org.openide.awt.Mnemonics.setLocalizedText(fileNameRadioButton, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.fileNameRadioButton.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(fileNameRadioButton, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.fileNameRadioButton.text")); // NOI18N
fileNameRadioButton.setEnabled(false); fileNameRadioButton.setEnabled(false);
rulePathFilterTextField.setEditable(false); rulePathConditionTextField.setEditable(false);
rulePathFilterTextField.setFont(rulePathFilterTextField.getFont().deriveFont(rulePathFilterTextField.getFont().getStyle() & ~java.awt.Font.BOLD, 11)); rulePathConditionTextField.setFont(rulePathConditionTextField.getFont().deriveFont(rulePathConditionTextField.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
rulePathFilterTextField.setText(org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.rulePathFilterTextField.text")); // NOI18N rulePathConditionTextField.setText(org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.rulePathConditionTextField.text")); // NOI18N
ignoreKnownFilesCheckbox.setFont(ignoreKnownFilesCheckbox.getFont().deriveFont(ignoreKnownFilesCheckbox.getFont().getStyle() & ~java.awt.Font.BOLD, 11)); ignoreKnownFilesCheckbox.setFont(ignoreKnownFilesCheckbox.getFont().deriveFont(ignoreKnownFilesCheckbox.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
org.openide.awt.Mnemonics.setLocalizedText(ignoreKnownFilesCheckbox, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.ignoreKnownFilesCheckbox.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(ignoreKnownFilesCheckbox, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.ignoreKnownFilesCheckbox.text")); // NOI18N
@ -639,9 +639,9 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp
jLabel4.setFont(jLabel4.getFont().deriveFont(jLabel4.getFont().getStyle() & ~java.awt.Font.BOLD, 11)); jLabel4.setFont(jLabel4.getFont().deriveFont(jLabel4.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.jLabel4.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.jLabel4.text")); // NOI18N
rulePathFilterRegexCheckBox.setFont(rulePathFilterRegexCheckBox.getFont().deriveFont(rulePathFilterRegexCheckBox.getFont().getStyle() & ~java.awt.Font.BOLD, 11)); rulePathConditionRegexCheckBox.setFont(rulePathConditionRegexCheckBox.getFont().deriveFont(rulePathConditionRegexCheckBox.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
org.openide.awt.Mnemonics.setLocalizedText(rulePathFilterRegexCheckBox, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.rulePathFilterRegexCheckBox.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(rulePathConditionRegexCheckBox, org.openide.util.NbBundle.getMessage(InterestingItemDefsPanel.class, "InterestingItemDefsPanel.rulePathConditionRegexCheckBox.text")); // NOI18N
rulePathFilterRegexCheckBox.setEnabled(false); rulePathConditionRegexCheckBox.setEnabled(false);
jScrollPane2.setFont(jScrollPane2.getFont().deriveFont(jScrollPane2.getFont().getStyle() & ~java.awt.Font.BOLD, 11)); jScrollPane2.setFont(jScrollPane2.getFont().deriveFont(jScrollPane2.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
@ -713,7 +713,7 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp
.addComponent(fileNameExtensionRadioButton, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(fileNameExtensionRadioButton, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(fileNameRegexCheckbox)) .addComponent(fileNameRegexCheckbox))
.addComponent(rulePathFilterRegexCheckBox))) .addComponent(rulePathConditionRegexCheckBox)))
.addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createSequentialGroup()
.addGap(354, 354, 354) .addGap(354, 354, 354)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -722,7 +722,7 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp
.addComponent(jLabel8)) .addComponent(jLabel8))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(rulePathFilterTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(rulePathConditionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(mimeTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(mimeTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 248, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(fileNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(fileNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createSequentialGroup()
@ -762,7 +762,7 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp
.addContainerGap(26, Short.MAX_VALUE)) .addContainerGap(26, Short.MAX_VALUE))
); );
jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {fileNameTextField, mimeTypeComboBox, rulePathFilterTextField}); jPanel1Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {fileNameTextField, mimeTypeComboBox, rulePathConditionTextField});
jPanel1Layout.setVerticalGroup( jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -806,9 +806,9 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel4) .addComponent(jLabel4)
.addComponent(rulePathFilterTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(rulePathConditionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(rulePathFilterRegexCheckBox) .addComponent(rulePathConditionRegexCheckBox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel7) .addComponent(jLabel7)
@ -937,8 +937,8 @@ final class InterestingItemDefsPanel extends IngestModuleGlobalSettingsPanel imp
private javax.swing.JComboBox mimeTypeComboBox; private javax.swing.JComboBox mimeTypeComboBox;
private javax.swing.JButton newRuleButton; private javax.swing.JButton newRuleButton;
private javax.swing.JButton newSetButton; private javax.swing.JButton newSetButton;
private javax.swing.JCheckBox rulePathFilterRegexCheckBox; private javax.swing.JCheckBox rulePathConditionRegexCheckBox;
private javax.swing.JTextField rulePathFilterTextField; private javax.swing.JTextField rulePathConditionTextField;
private javax.swing.JList<FilesSet.Rule> rulesList; private javax.swing.JList<FilesSet.Rule> rulesList;
private javax.swing.JLabel rulesListLabel; private javax.swing.JLabel rulesListLabel;
private javax.swing.JScrollPane rulesListScrollPane; private javax.swing.JScrollPane rulesListScrollPane;