Javadoc. Minor formatting. Inline local var. Use ternary expression.
Distinguish fileSelectInfo vs. fileInfo in param names.
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileFilter.java
index 4fd2c18..216d9f4 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileFilter.java
@@ -24,9 +24,9 @@
/**
* Determines if a file or folder should be selected.
*
- * @param fileInfo the file or folder to select.
+ * @param fileSelectInfo the file or folder to select.
* @return true if the file should be selected.
* @throws FileSystemException Thrown for file system errors (since 2.4.)
*/
- boolean accept(final FileSelectInfo fileInfo) throws FileSystemException;
+ boolean accept(final FileSelectInfo fileSelectInfo) throws FileSystemException;
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileFilterSelector.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileFilterSelector.java
index da5ed10..44f6958 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileFilterSelector.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileFilterSelector.java
@@ -48,11 +48,7 @@
*/
@Override
public boolean includeFile(final FileSelectInfo fileInfo) throws Exception {
- if (!super.includeFile(fileInfo)) {
- return false;
- }
-
- return accept(fileInfo);
+ return super.includeFile(fileInfo) ? accept(fileInfo) : false;
}
/**
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileSystemManager.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileSystemManager.java
index ea0f5a4..bfadd59 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileSystemManager.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/FileSystemManager.java
@@ -327,10 +327,10 @@
FileName resolveName(FileName root, String name, NameScope scope) throws FileSystemException;
/**
- * Resolves the uri to a file name.
+ * Resolves the URI to a file name.
*
- * @param uri The uri to resolve.
- * @return A FileName that matches the uri.
+ * @param uri The URI to resolve.
+ * @return A FileName that matches the URI.
* @throws FileSystemException if this is not possible.
*/
FileName resolveURI(String uri) throws FileSystemException;
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/Selectors.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/Selectors.java
index 1759692..92190d8 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/Selectors.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/Selectors.java
@@ -58,7 +58,7 @@
public static final FileSelector SELECT_ALL = new AllFileSelector();
/**
- * Prevent the class from being instantiated.
+ * Prevents the class from being instantiated.
*/
private Selectors() {
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/UserAuthenticationData.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/UserAuthenticationData.java
index 1be00ba..418a8ed 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/UserAuthenticationData.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/UserAuthenticationData.java
@@ -30,6 +30,7 @@
* Represents a user authentication item.
*/
public static class Type implements Comparable<Type> {
+
/** The type name */
private final String type;
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/VFS.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/VFS.java
index 225169d..dcef40c 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/VFS.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/VFS.java
@@ -59,8 +59,7 @@
try {
// Initialize
- final Method initMethod = mgrClass.getMethod("init", (Class[]) null);
- initMethod.invoke(mgr, (Object[]) null);
+ mgrClass.getMethod("init", (Class[]) null).invoke(mgr, (Object[]) null);
} catch (final NoSuchMethodException ignored) {
/* Ignore; don't initialize. */
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/AgeFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/AgeFileFilter.java
index 9a552f2..285a2ad 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/AgeFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/AgeFileFilter.java
@@ -18,6 +18,7 @@
import java.io.Serializable;
import java.util.Date;
+import java.util.Objects;
import org.apache.commons.vfs2.FileContent;
import org.apache.commons.vfs2.FileFilter;
@@ -73,9 +74,7 @@
* @throws IllegalArgumentException if the file is {@code null}
*/
private static boolean isFileNewer(final FileObject fileObject, final long timeMillis) throws FileSystemException {
- if (fileObject == null) {
- throw new IllegalArgumentException("No specified file");
- }
+ Objects.requireNonNull(fileObject, "fileObject");
if (!fileObject.exists()) {
return false;
}
@@ -175,8 +174,7 @@
*/
@Override
public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException {
- final boolean newer = isFileNewer(fileInfo.getFile(), cutoff);
- return acceptOlder != newer;
+ return acceptOlder != isFileNewer(fileInfo.getFile(), cutoff);
}
/**
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/AndFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/AndFileFilter.java
index d2a4770..ad7ef48 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/AndFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/AndFileFilter.java
@@ -82,12 +82,12 @@
}
@Override
- public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException {
+ public boolean accept(final FileSelectInfo fileSelectInfo) throws FileSystemException {
if (this.fileFilters.isEmpty()) {
return false;
}
for (final FileFilter fileFilter : fileFilters) {
- if (!fileFilter.accept(fileInfo)) {
+ if (!fileFilter.accept(fileSelectInfo)) {
return false;
}
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/CanExecuteFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/CanExecuteFileFilter.java
index 35e506d..5aab917 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/CanExecuteFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/CanExecuteFileFilter.java
@@ -74,14 +74,14 @@
/**
* Checks to see if the file can be executed.
*
- * @param fileInfo the File to check.
+ * @param fileSelectInfo the File to check.
*
* @return {@code true} if the file can be executed, otherwise {@code false}.
* @throws FileSystemException Thrown for file system errors.
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException {
- return fileInfo.getFile().isExecutable();
+ public boolean accept(final FileSelectInfo fileSelectInfo) throws FileSystemException {
+ return fileSelectInfo.getFile().isExecutable();
}
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/CanReadFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/CanReadFileFilter.java
index f39d13b..d115137 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/CanReadFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/CanReadFileFilter.java
@@ -92,14 +92,14 @@
/**
* Checks to see if the file can be read.
*
- * @param fileInfo the File to check.
+ * @param fileSelectInfo the File to check.
*
* @return {@code true} if the file can be read, otherwise {@code false}.
* @throws FileSystemException Thrown for file system errors.
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException {
- return fileInfo.getFile().isReadable();
+ public boolean accept(final FileSelectInfo fileSelectInfo) throws FileSystemException {
+ return fileSelectInfo.getFile().isReadable();
}
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/CanWriteFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/CanWriteFileFilter.java
index e72f430..a5b9fcc 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/CanWriteFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/CanWriteFileFilter.java
@@ -83,14 +83,14 @@
/**
* Checks to see if the file can be written to.
*
- * @param fileInfo the File to check
+ * @param fileSelectInfo the File to check
*
* @return {@code true} if the file can be written to, otherwise {@code false}.
* @throws FileSystemException Thrown for file system errors.
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException {
- try (final FileObject file = fileInfo.getFile()) {
+ public boolean accept(final FileSelectInfo fileSelectInfo) throws FileSystemException {
+ try (final FileObject file = fileSelectInfo.getFile()) {
final FileSystem fileSystem = file.getFileSystem();
if (file.exists()) {
if (!fileSystem.hasCapability(Capability.WRITE_CONTENT)) {
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/DirectoryFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/DirectoryFileFilter.java
index 04ab42b..9d7f208 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/DirectoryFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/DirectoryFileFilter.java
@@ -61,14 +61,14 @@
/**
* Checks to see if the file is a directory.
*
- * @param fileInfo the File to check
+ * @param fileSelectInfo the File to check
*
* @return {@code true} if the file is a directory
* @throws FileSystemException Thrown for file system errors.
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException {
- return fileInfo.getFile().getType() == FileType.FOLDER;
+ public boolean accept(final FileSelectInfo fileSelectInfo) throws FileSystemException {
+ return fileSelectInfo.getFile().getType() == FileType.FOLDER;
}
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/EmptyFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/EmptyFileFilter.java
index 99316cb..5121642 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/EmptyFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/EmptyFileFilter.java
@@ -79,14 +79,14 @@
/**
* Checks to see if the file is empty. A non-existing file is also considered empty.
*
- * @param fileInfo the file or directory to check
+ * @param fileSelectInfo the file or directory to check
*
* @return {@code true} if the file or directory is <i>empty</i>, otherwise {@code false}.
* @throws FileSystemException Thrown for file system errors.
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException {
- try (final FileObject file = fileInfo.getFile()) {
+ public boolean accept(final FileSelectInfo fileSelectInfo) throws FileSystemException {
+ try (final FileObject file = fileSelectInfo.getFile()) {
if (!file.exists()) {
return true;
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/FalseFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/FalseFileFilter.java
index 04f5c83..73e5440 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/FalseFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/FalseFileFilter.java
@@ -46,12 +46,12 @@
/**
* Returns false.
*
- * @param fileInfo the file to check (ignored)
+ * @param fileSelectInfo the file to check (ignored)
*
* @return Always {@code false}
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) {
+ public boolean accept(final FileSelectInfo fileSelectInfo) {
return false;
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/FileFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/FileFileFilter.java
index ef8c145..88b4c85 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/FileFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/FileFileFilter.java
@@ -59,14 +59,14 @@
/**
* Checks to see if the file is a file.
*
- * @param fileInfo the File to check
+ * @param fileSelectInfo the File to check
*
* @return true if the file is a file
* @throws FileSystemException Thrown for file system errors.
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException {
- return fileInfo.getFile().getType() == FileType.FILE;
+ public boolean accept(final FileSelectInfo fileSelectInfo) throws FileSystemException {
+ return fileSelectInfo.getFile().getType() == FileType.FILE;
}
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/HiddenFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/HiddenFileFilter.java
index 89e8afd..f9f9698 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/HiddenFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/HiddenFileFilter.java
@@ -75,17 +75,17 @@
/**
* Checks to see if the file is hidden. Non existing files won't be accepted.
*
- * @param fileInfo the File to check
+ * @param fileSelectInfo the File to check
*
* @return {@code true} if the file is <i>hidden</i>, otherwise {@code false}.
* @throws FileSystemException Thrown for file system errors.
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException {
- if (!fileInfo.getFile().exists()) {
+ public boolean accept(final FileSelectInfo fileSelectInfo) throws FileSystemException {
+ if (!fileSelectInfo.getFile().exists()) {
return false;
}
- return fileInfo.getFile().isHidden();
+ return fileSelectInfo.getFile().isHidden();
}
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/NameFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/NameFileFilter.java
index 10f99e0..0684ee2 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/NameFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/NameFileFilter.java
@@ -111,13 +111,13 @@
/**
* Checks to see if the file name matches.
*
- * @param fileInfo the File to check
+ * @param fileSelectInfo the File to check
*
* @return true if the file name matches
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) {
- final String name = fileInfo.getFile().getName().getBaseName();
+ public boolean accept(final FileSelectInfo fileSelectInfo) {
+ final String name = fileSelectInfo.getFile().getName().getBaseName();
for (final String name2 : this.names) {
if (caseSensitivity.checkEquals(name, name2)) {
return true;
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/NotFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/NotFileFilter.java
index 73b4f4b..15a8c74 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/NotFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/NotFileFilter.java
@@ -52,14 +52,14 @@
* Returns the logical NOT of the underlying filter's return value for the same
* File.
*
- * @param fileInfo the File to check
+ * @param fileSelectInfo the File to check
*
* @return {@code true} if the filter returns {@code false}
* @throws FileSystemException Thrown for file system errors.
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException {
- return !filter.accept(fileInfo);
+ public boolean accept(final FileSelectInfo fileSelectInfo) throws FileSystemException {
+ return !filter.accept(fileSelectInfo);
}
/**
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/OrFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/OrFileFilter.java
index b0306e0..5ec14db 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/OrFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/OrFileFilter.java
@@ -82,9 +82,9 @@
}
@Override
- public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException {
+ public boolean accept(final FileSelectInfo fileSelectInfo) throws FileSystemException {
for (final FileFilter fileFilter : fileFilters) {
- if (fileFilter.accept(fileInfo)) {
+ if (fileFilter.accept(fileSelectInfo)) {
return true;
}
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/PrefixFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/PrefixFileFilter.java
index 6694bd4..7ebc28e 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/PrefixFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/PrefixFileFilter.java
@@ -110,13 +110,13 @@
/**
* Checks to see if the file name starts with the prefix.
*
- * @param fileInfo the File to check
+ * @param fileSelectInfo the File to check
*
* @return true if the file name starts with one of our prefixes
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) {
- final String name = fileInfo.getFile().getName().getBaseName();
+ public boolean accept(final FileSelectInfo fileSelectInfo) {
+ final String name = fileSelectInfo.getFile().getName().getBaseName();
for (final String prefix : this.prefixes) {
if (caseSensitivity.checkStartsWith(name, prefix)) {
return true;
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/RegexFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/RegexFileFilter.java
index dc99d44..82f8aa9 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/RegexFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/RegexFileFilter.java
@@ -117,13 +117,13 @@
/**
* Checks to see if the file name matches one of the regular expressions.
*
- * @param fileInfo the File to check
+ * @param fileSelectInfo the File to check
*
* @return true if the file matches one of the regular expressions
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) {
- final String name = fileInfo.getFile().getName().getBaseName();
+ public boolean accept(final FileSelectInfo fileSelectInfo) {
+ final String name = fileSelectInfo.getFile().getName().getBaseName();
return pattern.matcher(name).matches();
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SizeFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SizeFileFilter.java
index f0f1140..fdaa44f 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SizeFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SizeFileFilter.java
@@ -93,14 +93,14 @@
* Non-existing files return always false (will never be accepted).
* </p>
*
- * @param fileInfo the File to check
+ * @param fileSelectInfo the File to check
*
* @return true if the file name matches
* @throws FileSystemException Thrown for file system errors.
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException {
- try (final FileObject file = fileInfo.getFile()) {
+ public boolean accept(final FileSelectInfo fileSelectInfo) throws FileSystemException {
+ try (final FileObject file = fileSelectInfo.getFile()) {
if (!file.exists()) {
return false;
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SizeRangeFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SizeRangeFileFilter.java
index 13d93e0..18104f3 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SizeRangeFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SizeRangeFileFilter.java
@@ -47,8 +47,8 @@
}
@Override
- public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException {
- return filter.accept(fileInfo);
+ public boolean accept(final FileSelectInfo fileSelectInfo) throws FileSystemException {
+ return filter.accept(fileSelectInfo);
}
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SuffixFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SuffixFileFilter.java
index 2437278..68e609f 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SuffixFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SuffixFileFilter.java
@@ -108,13 +108,13 @@
/**
* Checks to see if the file name ends with the suffix.
*
- * @param fileInfo the File to check
+ * @param fileSelectInfo the File to check
*
* @return true if the file name ends with one of our suffixes
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) {
- final String name = fileInfo.getFile().getName().getBaseName();
+ public boolean accept(final FileSelectInfo fileSelectInfo) {
+ final String name = fileSelectInfo.getFile().getName().getBaseName();
for (final String suffix : this.suffixes) {
if (caseSensitivity.checkEndsWith(name, suffix)) {
return true;
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SymbolicLinkFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SymbolicLinkFileFilter.java
index bdafd6e..3dd1d02 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SymbolicLinkFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/SymbolicLinkFileFilter.java
@@ -73,17 +73,17 @@
/**
* Checks to see if the file is a symbolic link. Non existing files won't be accepted.
*
- * @param fileInfo the file to check
+ * @param fileSelectInfo the file to check
*
* @return {@code true} if the file is <i>symbolic link</i>, otherwise {@code false}.
* @throws FileSystemException Thrown for file system errors.
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) throws FileSystemException {
- if (!fileInfo.getFile().exists()) {
+ public boolean accept(final FileSelectInfo fileSelectInfo) throws FileSystemException {
+ if (!fileSelectInfo.getFile().exists()) {
return false;
}
- return fileInfo.getFile().isSymbolicLink();
+ return fileSelectInfo.getFile().isSymbolicLink();
}
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/TrueFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/TrueFileFilter.java
index 3725998..9a4a5ca 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/TrueFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/TrueFileFilter.java
@@ -46,12 +46,12 @@
/**
* Returns true.
*
- * @param fileInfo the file to check (ignored)
+ * @param fileSelectInfo the file to check (ignored)
*
* @return Always {@code true}
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) {
+ public boolean accept(final FileSelectInfo fileSelectInfo) {
return true;
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/WildcardFileFilter.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/WildcardFileFilter.java
index 350f584..f7a5543 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/WildcardFileFilter.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/filter/WildcardFileFilter.java
@@ -122,13 +122,13 @@
/**
* Checks to see if the file name matches one of the wildcards.
*
- * @param fileInfo the file to check
+ * @param fileSelectInfo the file to check
*
* @return true if the file name matches one of the wildcards
*/
@Override
- public boolean accept(final FileSelectInfo fileInfo) {
- final String name = fileInfo.getFile().getName().getBaseName();
+ public boolean accept(final FileSelectInfo fileSelectInfo) {
+ final String name = fileSelectInfo.getFile().getName().getBaseName();
for (final String wildcard : wildcards) {
if (wildcardMatch(name, wildcard, caseSensitivity)) {
return true;
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileMonitor.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileMonitor.java
index c37ecbe..69a6d20 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileMonitor.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/impl/DefaultFileMonitor.java
@@ -235,11 +235,7 @@
* @param delay The delay period.
*/
public void setDelay(final long delay) {
- if (delay > 0) {
- this.delay = delay;
- } else {
- this.delay = DEFAULT_DELAY;
- }
+ this.delay = delay > 0 ? delay : DEFAULT_DELAY;
}
/**
diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/filter/AndFileFilterTest.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/filter/AndFileFilterTest.java
index 2762692..c08f1da 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/filter/AndFileFilterTest.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/filter/AndFileFilterTest.java
@@ -169,7 +169,7 @@
private static class DummyFilter implements FileFilter {
@Override
- public boolean accept(final FileSelectInfo fileInfo) {
+ public boolean accept(final FileSelectInfo fileSelectInfo) {
return false;
}
@@ -181,7 +181,7 @@
private static class True implements FileFilter {
@Override
- public boolean accept(final FileSelectInfo fileInfo) {
+ public boolean accept(final FileSelectInfo fileSelectInfo) {
return true;
}
@@ -193,7 +193,7 @@
private static class False implements FileFilter {
@Override
- public boolean accept(final FileSelectInfo fileInfo) {
+ public boolean accept(final FileSelectInfo fileSelectInfo) {
return false;
}