You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/09/07 14:19:46 UTC

[commons-io] branch master updated: Cleaner Javadoc examples.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
     new c63c6c9  Cleaner Javadoc examples.
c63c6c9 is described below

commit c63c6c919d482bd53fccc44a3a8599976ad71911
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Tue Sep 7 10:19:44 2021 -0400

    Cleaner Javadoc examples.
---
 src/main/java/org/apache/commons/io/file/AccumulatorPathVisitor.java | 2 +-
 src/main/java/org/apache/commons/io/filefilter/AgeFileFilter.java    | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/io/file/AccumulatorPathVisitor.java b/src/main/java/org/apache/commons/io/file/AccumulatorPathVisitor.java
index 4b29163..3877db5 100644
--- a/src/main/java/org/apache/commons/io/file/AccumulatorPathVisitor.java
+++ b/src/main/java/org/apache/commons/io/file/AccumulatorPathVisitor.java
@@ -37,7 +37,7 @@ import org.apache.commons.io.file.Counters.PathCounters;
  * <pre>
  * Path dir = Paths.get("");
  * // We are interested in files older than one day
- * long cutoff = System.currentTimeMillis() - (24 * 60 * 60 * 1000);
+ * Instant cutoff = Instant.now().minus(Duration.ofDays(1));
  * AccumulatorPathVisitor visitor = AccumulatorPathVisitor.withLongCounters(new AgeFileFilter(cutoff));
  * //
  * // Walk one dir
diff --git a/src/main/java/org/apache/commons/io/filefilter/AgeFileFilter.java b/src/main/java/org/apache/commons/io/filefilter/AgeFileFilter.java
index 448208f..c31aaf5 100644
--- a/src/main/java/org/apache/commons/io/filefilter/AgeFileFilter.java
+++ b/src/main/java/org/apache/commons/io/filefilter/AgeFileFilter.java
@@ -37,7 +37,7 @@ import org.apache.commons.io.file.PathUtils;
  * <pre>
  * Path dir = Paths.get("");
  * // We are interested in files older than one day
- * long cutoff = System.currentTimeMillis() - (24 * 60 * 60 * 1000);
+ * Instant cutoff = Instant.now().minus(Duration.ofDays(1));
  * String[] files = dir.list(new AgeFileFilter(cutoff));
  * for (String file : files) {
  *     System.out.println(file);
@@ -48,7 +48,7 @@ import org.apache.commons.io.file.PathUtils;
  * <pre>
  * Path dir = Paths.get("");
  * // We are interested in files older than one day
- * long cutoff = System.currentTimeMillis() - (24 * 60 * 60 * 1000);
+ * Instant cutoff = Instant.now().minus(Duration.ofDays(1));
  * AccumulatorPathVisitor visitor = AccumulatorPathVisitor.withLongCounters(new AgeFileFilter(cutoff));
  * //
  * // Walk one dir