|
|
@@ -88,10 +88,10 @@ public class DateSelector extends BaseExtendSelector { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* For users that prefer to express time in milliseconds since 1970 |
|
|
|
|
|
|
|
|
* Set the time; for users who prefer to express time in ms since 1970. |
|
|
* |
|
|
* |
|
|
* @param millis the time to compare file's last modified date to, |
|
|
* @param millis the time to compare file's last modified date to, |
|
|
* expressed in milliseconds |
|
|
|
|
|
|
|
|
* expressed in milliseconds. |
|
|
*/ |
|
|
*/ |
|
|
public void setMillis(long millis) { |
|
|
public void setMillis(long millis) { |
|
|
this.millis = millis; |
|
|
this.millis = millis; |
|
|
@@ -99,7 +99,7 @@ public class DateSelector extends BaseExtendSelector { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Returns the millisecond value the selector is set for. |
|
|
* Returns the millisecond value the selector is set for. |
|
|
* @return the millisecond value |
|
|
|
|
|
|
|
|
* @return the millisecond value. |
|
|
*/ |
|
|
*/ |
|
|
public long getMillis() { |
|
|
public long getMillis() { |
|
|
if (dateTime != null) { |
|
|
if (dateTime != null) { |
|
|
@@ -109,19 +109,19 @@ public class DateSelector extends BaseExtendSelector { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Sets the date. The user must supply it in MM/DD/YYYY HH:MM AM_PM |
|
|
|
|
|
* format |
|
|
|
|
|
|
|
|
* Sets the date. The user must supply it in MM/DD/YYYY HH:MM AM_PM format, |
|
|
|
|
|
* unless an alternate pattern is specified via the pattern attribute. |
|
|
* |
|
|
* |
|
|
* @param dateTime a string in MM/DD/YYYY HH:MM AM_PM format |
|
|
|
|
|
|
|
|
* @param dateTime a formatted date <code>String</code>. |
|
|
*/ |
|
|
*/ |
|
|
public void setDatetime(String dateTime) { |
|
|
public void setDatetime(String dateTime) { |
|
|
this.dateTime = dateTime; |
|
|
this.dateTime = dateTime; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Should we be checking dates on directories? |
|
|
|
|
|
|
|
|
* Set whether to check dates on directories. |
|
|
* |
|
|
* |
|
|
* @param includeDirs whether to check the timestamp on directories |
|
|
|
|
|
|
|
|
* @param includeDirs whether to check the timestamp on directories. |
|
|
*/ |
|
|
*/ |
|
|
public void setCheckdirs(boolean includeDirs) { |
|
|
public void setCheckdirs(boolean includeDirs) { |
|
|
this.includeDirs = includeDirs; |
|
|
this.includeDirs = includeDirs; |
|
|
@@ -130,7 +130,7 @@ public class DateSelector extends BaseExtendSelector { |
|
|
/** |
|
|
/** |
|
|
* Sets the number of milliseconds leeway we will give before we consider |
|
|
* Sets the number of milliseconds leeway we will give before we consider |
|
|
* a file not to have matched a date. |
|
|
* a file not to have matched a date. |
|
|
* @param granularity the number of milliconds leeway |
|
|
|
|
|
|
|
|
* @param granularity the number of milliseconds leeway. |
|
|
*/ |
|
|
*/ |
|
|
public void setGranularity(int granularity) { |
|
|
public void setGranularity(int granularity) { |
|
|
this.granularity = granularity; |
|
|
this.granularity = granularity; |
|
|
@@ -140,16 +140,16 @@ public class DateSelector extends BaseExtendSelector { |
|
|
* Sets the type of comparison to be done on the file's last modified |
|
|
* Sets the type of comparison to be done on the file's last modified |
|
|
* date. |
|
|
* date. |
|
|
* |
|
|
* |
|
|
* @param cmp The comparison to perform, an EnumeratedAttribute |
|
|
|
|
|
|
|
|
* @param cmp The comparison to perform, an EnumeratedAttribute. |
|
|
*/ |
|
|
*/ |
|
|
public void setWhen(TimeComparisons tcmp) { |
|
|
public void setWhen(TimeComparisons tcmp) { |
|
|
this.cmp = tcmp.getIndex(); |
|
|
this.cmp = tcmp.getIndex(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Sets the pattern to be used for the SimpleDateFormat |
|
|
|
|
|
|
|
|
* Sets the pattern to be used for the SimpleDateFormat. |
|
|
* |
|
|
* |
|
|
* @param pattern the pattern that defines the date format |
|
|
|
|
|
|
|
|
* @param pattern the pattern that defines the date format. |
|
|
*/ |
|
|
*/ |
|
|
public void setPattern(String pattern) { |
|
|
public void setPattern(String pattern) { |
|
|
this.pattern = pattern; |
|
|
this.pattern = pattern; |
|
|
@@ -159,7 +159,7 @@ public class DateSelector extends BaseExtendSelector { |
|
|
* When using this as a custom selector, this method will be called. |
|
|
* When using this as a custom selector, this method will be called. |
|
|
* It translates each parameter into the appropriate setXXX() call. |
|
|
* It translates each parameter into the appropriate setXXX() call. |
|
|
* |
|
|
* |
|
|
* @param parameters the complete set of parameters for this selector |
|
|
|
|
|
|
|
|
* @param parameters the complete set of parameters for this selector. |
|
|
*/ |
|
|
*/ |
|
|
public void setParameters(Parameter[] parameters) { |
|
|
public void setParameters(Parameter[] parameters) { |
|
|
super.setParameters(parameters); |
|
|
super.setParameters(parameters); |
|
|
@@ -234,10 +234,10 @@ public class DateSelector extends BaseExtendSelector { |
|
|
* The heart of the matter. This is where the selector gets to decide |
|
|
* The heart of the matter. This is where the selector gets to decide |
|
|
* on the inclusion of a file in a particular fileset. |
|
|
* on the inclusion of a file in a particular fileset. |
|
|
* |
|
|
* |
|
|
* @param basedir the base directory the scan is being done from |
|
|
|
|
|
* @param filename is the name of the file to check |
|
|
|
|
|
* @param file is a java.io.File object the selector can use |
|
|
|
|
|
* @return whether the file should be selected or not |
|
|
|
|
|
|
|
|
* @param basedir the base directory from which the scan is being performed. |
|
|
|
|
|
* @param filename is the name of the file to check. |
|
|
|
|
|
* @param file is a java.io.File object the selector can use. |
|
|
|
|
|
* @return whether the file is selected. |
|
|
*/ |
|
|
*/ |
|
|
public boolean isSelected(File basedir, String filename, File file) { |
|
|
public boolean isSelected(File basedir, String filename, File file) { |
|
|
|
|
|
|
|
|
|