Clean up imports. Add @Deprecated. Use final.
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java
index fc23c96..312cbb7 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java
@@ -186,6 +186,7 @@
* @since 2.3
* @deprecated Use {@link #getConnectTimeout(FileSystemOptions)}.
*/
+ @Deprecated
public Integer getConnectTimeoutMillis(final FileSystemOptions options) {
return this.getDurationInteger(options, CONNECT_TIMEOUT, DEFAULT_CONNECT_TIMEOUT);
}
@@ -768,6 +769,7 @@
* @since 2.3
* @deprecated Use {@link #setSessionTimeout(FileSystemOptions, Duration)}.
*/
+ @Deprecated
public void setSessionTimeoutMillis(final FileSystemOptions options, final Integer timeout) {
this.setSessionTimeout(options, Duration.ofMillis(timeout));
}
diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java
index b0dad91..00dbd54 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/tar/TarFileSystem.java
@@ -17,7 +17,6 @@
package org.apache.commons.vfs2.provider.tar;
import java.io.File;
-import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/DefaultFileContentTest.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/DefaultFileContentTest.java
index 23bf03b..c483981 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/DefaultFileContentTest.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/DefaultFileContentTest.java
@@ -180,14 +180,14 @@
testStreamClosedInADifferentThread(content -> content.getOutputStream());
}
- private <T extends Closeable> void testStreamClosedInADifferentThread(FailableFunction<FileContent, T, IOException> getStream) throws Exception {
+ private <T extends Closeable> void testStreamClosedInADifferentThread(final FailableFunction<FileContent, T, IOException> getStream) throws Exception {
final File temp = File.createTempFile("temp-file-name", ".tmp");
final FileSystemManager fileSystemManager = VFS.getManager();
try (FileObject file = fileSystemManager.resolveFile(temp.getAbsolutePath())) {
- T stream = getStream.apply(file.getContent());
- AtomicBoolean check = new AtomicBoolean();
- Thread thread = new Thread(() -> {
+ final T stream = getStream.apply(file.getContent());
+ final AtomicBoolean check = new AtomicBoolean();
+ final Thread thread = new Thread(() -> {
try {
stream.close();
} catch (IOException exception) {
diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/util/NHttpFileServer.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/util/NHttpFileServer.java
index 138537e..99f26b2 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/util/NHttpFileServer.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/util/NHttpFileServer.java
@@ -32,7 +32,6 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
-import java.net.URLDecoder;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;