From 89ef7726adab095ba700b3c6e48c9cb962b4f502 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Fri, 22 Dec 2023 20:09:47 -0500 Subject: [PATCH] Javadoc --- .../io/monitor/FileAlterationObserver.java | 11 ++++++----- .../apache/commons/io/monitor/FileEntry.java | 19 +++++++++++++++++-- .../io/output/StringBuilderWriter.java | 2 ++ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java b/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java index c5960c447dd..a99368f7f63 100644 --- a/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java +++ b/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java @@ -357,7 +357,8 @@ private void doDelete(final FileEntry entry) { } /** - * Lists the files + * Lists the files in {@code file}. + * * @param file The file to list files for * @param entry the parent entry * @return The child files @@ -429,14 +430,14 @@ public void initialize() throws Exception { /** * Lists the contents of a directory * - * @param file The file to list the contents of + * @param directory The directory to list. * @return the directory contents or a zero length array if * the empty or the file is not a directory */ - private File[] listFiles(final File file) { + private File[] listFiles(final File directory) { File[] children = null; - if (file.isDirectory()) { - children = file.listFiles(fileFilter); + if (directory.isDirectory()) { + children = directory.listFiles(fileFilter); } if (children == null) { children = FileUtils.EMPTY_FILE_ARRAY; diff --git a/src/main/java/org/apache/commons/io/monitor/FileEntry.java b/src/main/java/org/apache/commons/io/monitor/FileEntry.java index 837f2df5cdf..2630cfaea03 100644 --- a/src/main/java/org/apache/commons/io/monitor/FileEntry.java +++ b/src/main/java/org/apache/commons/io/monitor/FileEntry.java @@ -57,13 +57,28 @@ public class FileEntry implements Serializable { static final FileEntry[] EMPTY_FILE_ENTRY_ARRAY = {}; + /** The parent. */ private final FileEntry parent; + + /** My children. */ private FileEntry[] children; + + /** Monitored file. */ private final File file; + + /** Monitored file name. */ private String name; + + /** Whether the file exists. */ private boolean exists; + + /** Whether the file is a directory or not. */ private boolean directory; + + /** The file's last modified timestamp. */ private SerializableFileTime lastModified = SerializableFileTime.EPOCH; + + /** The file's length. */ private long length; /** @@ -78,8 +93,8 @@ public FileEntry(final File file) { /** * Constructs a new monitor for a specified {@link File}. * - * @param parent The parent - * @param file The file being monitored + * @param parent The parent. + * @param file The file being monitored. */ public FileEntry(final FileEntry parent, final File file) { this.file = Objects.requireNonNull(file, "file"); diff --git a/src/main/java/org/apache/commons/io/output/StringBuilderWriter.java b/src/main/java/org/apache/commons/io/output/StringBuilderWriter.java index dfea1c154d4..f58b375037e 100644 --- a/src/main/java/org/apache/commons/io/output/StringBuilderWriter.java +++ b/src/main/java/org/apache/commons/io/output/StringBuilderWriter.java @@ -37,6 +37,8 @@ public class StringBuilderWriter extends Writer implements Serializable { private static final long serialVersionUID = -146927496096066153L; + + /** The append target. */ private final StringBuilder builder; /**