Crossfire JXClient, Trunk
Public Member Functions | Private Member Functions | Private Attributes | List of all members
com.sun.jmx.examples.scandir.config.FileMatch Class Reference
Inheritance diagram for com.sun.jmx.examples.scandir.config.FileMatch:
Inheritance graph
Collaboration diagram for com.sun.jmx.examples.scandir.config.FileMatch:
Collaboration graph

Public Member Functions

boolean accept (File f)
 
boolean equals (Object o)
 
 FileMatch ()
 
String getDirectoryPattern ()
 
String getFilePattern ()
 
Date getLastModifiedAfter ()
 
Date getLastModifiedBefore ()
 
long getSizeExceedsMaxBytes ()
 
int hashCode ()
 
void setDirectoryPattern (String directoryPattern)
 
void setFilePattern (String filePattern)
 
void setLastModifiedAfter (Date lastModifiedAfter)
 
void setLastModifiedBefore (Date lastModifiedBefore)
 
void setSizeExceedsMaxBytes (long sizeLimitInBytes)
 

Private Member Functions

Object[] toArray ()
 

Private Attributes

String directoryPattern
 
String filePattern
 
Date lastModifiedAfter
 
Date lastModifiedBefore
 
long sizeExceedsMaxBytes
 

Detailed Description

The FileMatch Java Bean is used to model the configuration of a FileFilter which matches files against a set of criteria.

The FileMatch class also implements FileFilter - applying an

AND

on all its conditions.

OR

conditions can be obtained by supplying several instances of FileMatch to the encapsulating DirectoryScannerConfig, which respectively applies an

OR

on all its

<FileFilter>

elements.

This class is annotated for XML binding.

Author
Sun Microsystems, 2006 - All rights reserved.

Definition at line 72 of file FileMatch.java.

Constructor & Destructor Documentation

◆ FileMatch()

com.sun.jmx.examples.scandir.config.FileMatch.FileMatch ( )

Creates a new instance of FileMatch

Definition at line 110 of file FileMatch.java.

Member Function Documentation

◆ accept()

boolean com.sun.jmx.examples.scandir.config.FileMatch.accept ( File  f)

A file is accepted when all the criteria that have been set are matched.

Parameters
fThe file to match against the configured criteria.
Returns
true
if the file matches all criteria,
false
otherwise.

Definition at line 261 of file FileMatch.java.

◆ equals()

boolean com.sun.jmx.examples.scandir.config.FileMatch.equals ( Object  o)

Definition at line 309 of file FileMatch.java.

References com.sun.jmx.examples.scandir.config.FileMatch.toArray().

Here is the call graph for this function:

◆ getDirectoryPattern()

String com.sun.jmx.examples.scandir.config.FileMatch.getDirectoryPattern ( )

Getter for property directoryPattern. This is a regular expression against which directory names should be matched. Applies only to directory, and tells whether a directory should be included or excluded from the search.

If File.isDirectory() && directoryPattern!=null && File.getName().matches(directoryPattern), then File matches this filter.
If File.isDirectory() && directoryPattern!=null && File.getName().matches(directoryPattern)==false, then File doesn't match this filter.

See also
java.util.regex.Pattern
java.lang.String::matches(java.lang.String)
Returns
Value of property directoryPattern.

Definition at line 130 of file FileMatch.java.

◆ getFilePattern()

String com.sun.jmx.examples.scandir.config.FileMatch.getFilePattern ( )

Getter for property filePattern. This is a regular expression against which file names should be matched. Applies only to files.

If File.isDirectory()==false && filePattern!=null && File.getName().matches(filePattern)==false, then File doesn't match this filter.

See also
java.util.regex.Pattern
java.lang.String::matches(java.lang.String)
Returns
Value of property filePatern.

Definition at line 161 of file FileMatch.java.

Referenced by com.sun.jmx.examples.scandir.ScanDirConfigTest.testAddDirectoryScanner().

Here is the caller graph for this function:

◆ getLastModifiedAfter()

Date com.sun.jmx.examples.scandir.config.FileMatch.getLastModifiedAfter ( )

Getter for property

. A file will be selected only if it was last modified after

.
This condition is ignored if

is

null

.

Returns
Value of property .

Definition at line 209 of file FileMatch.java.

◆ getLastModifiedBefore()

Date com.sun.jmx.examples.scandir.config.FileMatch.getLastModifiedBefore ( )

Getter for property

. A file will be selected only if it was last modified before

.
This condition is ignored if

is

null

.

Returns
Value of property .

Definition at line 234 of file FileMatch.java.

◆ getSizeExceedsMaxBytes()

long com.sun.jmx.examples.scandir.config.FileMatch.getSizeExceedsMaxBytes ( )

Getter for property sizeExceedsMaxBytes. Ignored if 0 or negative. Otherwise, files whose size in bytes does not exceed this limit will be excluded by this filter.

Returns
Value of property sizeExceedsMaxBytes.

Definition at line 185 of file FileMatch.java.

Referenced by com.sun.jmx.examples.scandir.ScanDirConfigTest.testAddDirectoryScanner().

Here is the caller graph for this function:

◆ hashCode()

int com.sun.jmx.examples.scandir.config.FileMatch.hashCode ( )

Definition at line 319 of file FileMatch.java.

◆ setDirectoryPattern()

void com.sun.jmx.examples.scandir.config.FileMatch.setDirectoryPattern ( String  directoryPattern)

Setter for property directoryPattern.

Parameters
directoryPatternNew value of property directoryPattern. This is a regular expression against which directory names should be matched.
See also
java.util.regex.Pattern
java.lang.String::matches(java.lang.String)

Definition at line 143 of file FileMatch.java.

◆ setFilePattern()

void com.sun.jmx.examples.scandir.config.FileMatch.setFilePattern ( String  filePattern)

Setter for property filePattern.

Parameters
filePatternNew value of property filePattern. This is a regular expression against which file names should be matched.
See also
java.util.regex.Pattern
java.lang.String::matches(java.lang.String)

Definition at line 173 of file FileMatch.java.

Referenced by com.sun.jmx.examples.scandir.ScanDirConfig.addDirectoryScanner(), and com.sun.jmx.examples.scandir.ScanDirConfigTest.testAddDirectoryScanner().

Here is the caller graph for this function:

◆ setLastModifiedAfter()

void com.sun.jmx.examples.scandir.config.FileMatch.setLastModifiedAfter ( Date  lastModifiedAfter)

Setter for property

.

Parameters
lastModifiedAfterA file will be selected only if it was last modified after .
This condition is ignored if is
null
.

Definition at line 220 of file FileMatch.java.

◆ setLastModifiedBefore()

void com.sun.jmx.examples.scandir.config.FileMatch.setLastModifiedBefore ( Date  lastModifiedBefore)

Setter for property

.

Parameters
lastModifiedBeforeA file will be selected only if it was last modified before .
This condition is ignored if is
null
.

Definition at line 245 of file FileMatch.java.

Referenced by com.sun.jmx.examples.scandir.ScanDirConfig.addDirectoryScanner().

Here is the caller graph for this function:

◆ setSizeExceedsMaxBytes()

void com.sun.jmx.examples.scandir.config.FileMatch.setSizeExceedsMaxBytes ( long  sizeLimitInBytes)

Setter for property sizeExceedsMaxBytes.

Parameters
sizeLimitInBytesNew value of property sizeExceedsMaxBytes. Ignored if 0 or negative. Otherwise, files whose size in bytes does not exceed this limit will be excluded by this filter.

Definition at line 196 of file FileMatch.java.

Referenced by com.sun.jmx.examples.scandir.ScanDirConfig.addDirectoryScanner().

Here is the caller graph for this function:

◆ toArray()

Object [] com.sun.jmx.examples.scandir.config.FileMatch.toArray ( )
private

Definition at line 300 of file FileMatch.java.

Referenced by com.sun.jmx.examples.scandir.config.FileMatch.equals().

Here is the caller graph for this function:

Member Data Documentation

◆ directoryPattern

String com.sun.jmx.examples.scandir.config.FileMatch.directoryPattern
private

A regular expression against which directory names should be matched.

Definition at line 83 of file FileMatch.java.

◆ filePattern

String com.sun.jmx.examples.scandir.config.FileMatch.filePattern
private

A regular expression against which file names should be matched.

Definition at line 88 of file FileMatch.java.

◆ lastModifiedAfter

Date com.sun.jmx.examples.scandir.config.FileMatch.lastModifiedAfter
private

A file which will be selected only if it was last modified after this date

Definition at line 99 of file FileMatch.java.

◆ lastModifiedBefore

Date com.sun.jmx.examples.scandir.config.FileMatch.lastModifiedBefore
private

A file which will be selected only if it was last modified before this date

Definition at line 105 of file FileMatch.java.

◆ sizeExceedsMaxBytes

long com.sun.jmx.examples.scandir.config.FileMatch.sizeExceedsMaxBytes
private

File whose size in bytes exceeds this limit will be selected.

Definition at line 93 of file FileMatch.java.


The documentation for this class was generated from the following file:
com.sun.jmx.examples.scandir.config.FileMatch.lastModifiedAfter
Date lastModifiedAfter
Definition: FileMatch.java:99
com.sun.jmx.examples.scandir.config.FileMatch.lastModifiedBefore
Date lastModifiedBefore
Definition: FileMatch.java:105