Skip to content
Permalink
Browse files
Remove checked exception from method signatures that do not throw them.
This maintains binary compatibility but not source compatibility.

- org.apache.commons.vfs2.impl.DefaultFileSystemConfigBuilder.setUserAuthenticator(FileSystemOptions,
UserAuthenticator)
- org.apache.commons.vfs2.impl.DefaultFileSystemManager.setBaseFile(File)
- org.apache.commons.vfs2.provider.LayeredFileNameParser.extractRootName(StringBuilder)
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder.setCompression(FileSystemOptions,
String)
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder.setConfigRepository(FileSystemOptions,
ConfigRepository)
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder.setIdentities(FileSystemOptions,
File...)
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder.setIdentityInfo(FileSystemOptions,
IdentityInfo...)
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder.setIdentityProvider(FileSystemOptions,
IdentityProvider...)
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder.setIdentityRepositoryFactory(FileSystemOptions,
IdentityRepositoryFactory)
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder.setKnownHosts(FileSystemOptions,
File)
- org.apache.commons.vfs2.provider.local.LocalFile.LocalFile(LocalFileSystem,
String, AbstractFileName)
- org.apache.commons.vfs2.provider.tar.TarFileObject.TarFileObject(AbstractFileName,
TarArchiveEntry, TarFileSystem, boolean)
- org.apache.commons.vfs2.provider.tar.TarFileSystem.createTarFileObject(AbstractFileName,
TarArchiveEntry)
- org.apache.commons.vfs2.provider.zip.ZipFileObject.ZipFileObject(AbstractFileName,
ZipEntry, ZipFileSystem, boolean)
- org.apache.commons.vfs2.provider.http4.Http4FileProvider.createHttpClientContext()
- org.apache.commons.vfs2.provider.http5.Http5FileProvider.createHttpClientContext()
- org.apache.commons.vfs2.provider.http4.Http4FileObject.getInternalURI()
- org.apache.commons.vfs2.provider.http5.Http5FileObject.getInternalURI()
  • Loading branch information
garydgregory committed Jul 15, 2021
1 parent 6c39b5f commit c4e381dec1b50d9c40f1f7095d53555aa479df50
Showing 16 changed files with 43 additions and 48 deletions.
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

checkstyle.maxlinelen = 120
checkstyle.maxlinelen = 160
checkstyle.lcurly.type = nl
checkstyle.lcurly.method = nl
checkstyle.lcurly.other = nl
@@ -18,7 +18,6 @@

import org.apache.commons.vfs2.FileSystem;
import org.apache.commons.vfs2.FileSystemConfigBuilder;
import org.apache.commons.vfs2.FileSystemException;
import org.apache.commons.vfs2.FileSystemOptions;
import org.apache.commons.vfs2.UserAuthenticator;

@@ -43,10 +42,8 @@ public static DefaultFileSystemConfigBuilder getInstance() {
*
* @param opts The FileSystemOptions.
* @param userAuthenticator The UserAuthenticator.
* @throws FileSystemException if an error occurs setting the UserAuthenticator.
*/
public void setUserAuthenticator(final FileSystemOptions opts, final UserAuthenticator userAuthenticator)
throws FileSystemException {
public void setUserAuthenticator(final FileSystemOptions opts, final UserAuthenticator userAuthenticator) {
setParam(opts, "userAuthenticator", userAuthenticator);
}

@@ -1014,9 +1014,8 @@ public void setBaseFile(final File baseFile) throws FileSystemException {
* Sets the base file to use when resolving relative URI.
*
* @param baseFile The new base FileObject.
* @throws FileSystemException if an error occurs.
*/
public void setBaseFile(final FileObject baseFile) throws FileSystemException {
public void setBaseFile(final FileObject baseFile) {
this.baseFile = baseFile;
}

@@ -87,9 +87,8 @@ public FileName parseUri(final VfsComponentContext context, final FileName baseF
*
* @param uri string builder which gets modified.
* @return the extracted root name.
* @throws FileSystemException if error occurs.
*/
protected String extractRootName(final StringBuilder uri) throws FileSystemException {
protected String extractRootName(final StringBuilder uri) {
// Looking for <name>!<abspath> (staring at the end)
final int maxlen = uri.length();
int pos = maxlen - 1;
@@ -200,9 +200,8 @@ protected FileContentInfoFactory getFileContentInfoFactory() {
* Return the internal {@code URI} object mapped to this file object.
*
* @return the internal {@code URI} object mapped to this file object
* @throws FileSystemException if any error occurs
*/
protected URI getInternalURI() throws FileSystemException {
protected URI getInternalURI() {
return internalURI;
}

@@ -229,11 +229,10 @@ protected HttpClientBuilder createHttpClientBuilder(final Http4FileSystemConfigB
* @param fileSystemOptions The FileSystem options
* @param authData The {@code UserAuthentiationData} object
* @return an {@link HttpClientContext} object
* @throws FileSystemException if an error occurs
*/
protected HttpClientContext createHttpClientContext(final Http4FileSystemConfigBuilder builder,
final GenericFileName rootName, final FileSystemOptions fileSystemOptions,
final UserAuthenticationData authData) throws FileSystemException {
final UserAuthenticationData authData) {

final HttpClientContext clientContext = HttpClientContext.create();
final CredentialsProvider credsProvider = new BasicCredentialsProvider();
@@ -199,9 +199,8 @@ protected FileContentInfoFactory getFileContentInfoFactory() {
* Return the internal {@code URI} object mapped to this file object.
*
* @return the internal {@code URI} object mapped to this file object
* @throws FileSystemException if any error occurs
*/
protected URI getInternalURI() throws FileSystemException {
protected URI getInternalURI() {
return internalURI;
}

@@ -161,12 +161,10 @@ private RequestConfig createDefaultRequestConfig(final Http5FileSystemConfigBuil
.build();
}

private HostnameVerifier createHostnameVerifier(final Http5FileSystemConfigBuilder builder,
final FileSystemOptions fileSystemOptions) throws FileSystemException {
private HostnameVerifier createHostnameVerifier(final Http5FileSystemConfigBuilder builder, final FileSystemOptions fileSystemOptions) {
if (!builder.isHostnameVerificationEnabled(fileSystemOptions)) {
return NoopHostnameVerifier.INSTANCE;
}

return new DefaultHostnameVerifier();
}

@@ -226,11 +224,10 @@ protected HttpClientBuilder createHttpClientBuilder(final Http5FileSystemConfigB
* @param fileSystemOptions The FileSystem options
* @param authData The {@code UserAuthentiationData} object
* @return an {@link HttpClientContext} object
* @throws FileSystemException if an error occurs
*/
protected HttpClientContext createHttpClientContext(final Http5FileSystemConfigBuilder builder,
final GenericFileName rootName, final FileSystemOptions fileSystemOptions,
final UserAuthenticationData authData) throws FileSystemException {
final UserAuthenticationData authData) {

final HttpClientContext clientContext = HttpClientContext.create();
final BasicCredentialsProvider credsProvider = new BasicCredentialsProvider();
@@ -49,10 +49,8 @@ public class LocalFile extends AbstractFileObject<LocalFileSystem> {
* @param fileSystem the file system this file belongs to.
* @param rootFile the root file for the file system.
* @param name the file name on this file system.
* @throws FileSystemException if an error occurs.
*/
protected LocalFile(final LocalFileSystem fileSystem, final String rootFile, final AbstractFileName name)
throws FileSystemException {
protected LocalFile(final LocalFileSystem fileSystem, final String rootFile, final AbstractFileName name) {
super(name, fileSystem);
this.rootFile = rootFile;
}
@@ -478,9 +478,8 @@ public boolean isLoadOpenSSHConfig(final FileSystemOptions options) {
*
* @param options The FileSystem options.
* @param compression The names of the compression algorithms, comma-separated.
* @throws FileSystemException if an error occurs.
*/
public void setCompression(final FileSystemOptions options, final String compression) throws FileSystemException {
public void setCompression(final FileSystemOptions options, final String compression) {
this.setParam(options, COMPRESSION, compression);
}

@@ -492,11 +491,9 @@ public void setCompression(final FileSystemOptions options, final String compres
*
* @param options The FileSystem options.
* @param configRepository An config repository.
* @throws FileSystemException if an error occurs.
* @see <a href="http://www.jcraft.com/jsch/examples/OpenSSHConfig.java.html">OpenSSHConfig</a>
*/
public void setConfigRepository(final FileSystemOptions options, final ConfigRepository configRepository)
throws FileSystemException {
public void setConfigRepository(final FileSystemOptions options, final ConfigRepository configRepository) {
this.setParam(options, CONFIG_REPOSITORY, configRepository);
}

@@ -554,11 +551,10 @@ public void setFileNameEncoding(final FileSystemOptions options, final String fi
*
* @param options The FileSystem options.
* @param identityFiles An array of identity Files.
* @throws FileSystemException if an error occurs.
* @deprecated As of 2.1 use {@link #setIdentityInfo(FileSystemOptions, IdentityInfo...)}
*/
@Deprecated
public void setIdentities(final FileSystemOptions options, final File... identityFiles) throws FileSystemException {
public void setIdentities(final FileSystemOptions options, final File... identityFiles) {
IdentityProvider[] info = null;
if (identityFiles != null) {
info = Stream.of(identityFiles).map(IdentityInfo::new).toArray(IdentityProvider[]::new);
@@ -571,13 +567,11 @@ public void setIdentities(final FileSystemOptions options, final File... identit
*
* @param options The FileSystem options.
* @param identites An array of identity info.
* @throws FileSystemException if an error occurs.
* @since 2.1
* @deprecated Use {@link #setIdentityProvider(FileSystemOptions,IdentityProvider...)}
*/
@Deprecated
public void setIdentityInfo(final FileSystemOptions options, final IdentityInfo... identites)
throws FileSystemException {
public void setIdentityInfo(final FileSystemOptions options, final IdentityInfo... identites) {
this.setParam(options, IDENTITIES, identites);
}

@@ -586,11 +580,9 @@ public void setIdentityInfo(final FileSystemOptions options, final IdentityInfo.
*
* @param options The FileSystem options.
* @param identites An array of identity info.
* @throws FileSystemException if an error occurs.
* @since 2.4
*/
public void setIdentityProvider(final FileSystemOptions options, final IdentityProvider... identites)
throws FileSystemException {
public void setIdentityProvider(final FileSystemOptions options, final IdentityProvider... identites) {
this.setParam(options, IDENTITIES, identites);
}

@@ -602,11 +594,9 @@ public void setIdentityProvider(final FileSystemOptions options, final IdentityP
*
* @param options The FileSystem options.
* @param factory An identity repository.
* @throws FileSystemException if an error occurs.
* @see <a href="http://www.jcraft.com/jsch-agent-proxy/">JSch agent proxy</a>
*/
public void setIdentityRepositoryFactory(final FileSystemOptions options, final IdentityRepositoryFactory factory)
throws FileSystemException {
public void setIdentityRepositoryFactory(final FileSystemOptions options, final IdentityRepositoryFactory factory) {
this.setParam(options, IDENTITY_REPOSITORY_FACTORY, factory);
}

@@ -630,9 +620,8 @@ public void setKeyExchangeAlgorithm(final FileSystemOptions options, final Strin
*
* @param options The FileSystem options.
* @param knownHosts The known hosts file.
* @throws FileSystemException if an error occurs.
*/
public void setKnownHosts(final FileSystemOptions options, final File knownHosts) throws FileSystemException {
public void setKnownHosts(final FileSystemOptions options, final File knownHosts) {
this.setParam(options, KNOWN_HOSTS, knownHosts);
}

@@ -38,7 +38,7 @@ public class TarFileObject extends AbstractFileObject<TarFileSystem> {
private FileType type;

protected TarFileObject(final AbstractFileName name, final TarArchiveEntry entry, final TarFileSystem fs,
final boolean tarExists) throws FileSystemException {
final boolean tarExists) {
super(name, fs);
setTarEntry(entry);
if (!tarExists) {
@@ -106,8 +106,7 @@ protected TarArchiveInputStream createTarFile(final File file) throws FileSystem
}
}

protected TarFileObject createTarFileObject(final AbstractFileName name, final TarArchiveEntry entry)
throws FileSystemException {
protected TarFileObject createTarFileObject(final AbstractFileName name, final TarArchiveEntry entry) {
return new TarFileObject(name, entry, this, true);
}

@@ -38,7 +38,7 @@ public class ZipFileObject extends AbstractFileObject<ZipFileSystem> {
private FileType type;

protected ZipFileObject(final AbstractFileName name, final ZipEntry entry, final ZipFileSystem fs,
final boolean zipExists) throws FileSystemException {
final boolean zipExists) {
super(name, fs);
setZipEntry(entry);
if (!zipExists) {
@@ -101,9 +101,8 @@ protected void tearDown() throws Exception {

/**
* Stops the embedded Apache HTTP Server.
* @throws InterruptedException
*/
private static void tearDownClass() throws InterruptedException {
private static void tearDownClass() {
if (Server != null) {
Server.close();
}
@@ -122,7 +122,7 @@ public void setUp() throws Exception {
}

@After
public void tearDown() throws Exception {
public void tearDown() {
for (final Closeable closeable : this.closeables) {
try {
closeable.close();
@@ -87,6 +87,27 @@ The <action> type attribute can be add,update,fix,remove.
<action type="fix" issue="VFS-784" dev="ggregory" due-to="satish-csi, Michael Osipov, Gary Gregory">
SSL Connection failing with http4 provider with squid proxy nginx combination.
</action>
<action type="fix" dev="ggregory" due-to="Gary Gregory">
Remove checked exception from method signatures that do not throw them. This maintains binary compatibility but not source compatibility.
- org.apache.commons.vfs2.impl.DefaultFileSystemConfigBuilder.setUserAuthenticator(FileSystemOptions, UserAuthenticator)
- org.apache.commons.vfs2.impl.DefaultFileSystemManager.setBaseFile(File)
- org.apache.commons.vfs2.provider.LayeredFileNameParser.extractRootName(StringBuilder)
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder.setCompression(FileSystemOptions, String)
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder.setConfigRepository(FileSystemOptions, ConfigRepository)
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder.setIdentities(FileSystemOptions, File...)
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder.setIdentityInfo(FileSystemOptions, IdentityInfo...)
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder.setIdentityProvider(FileSystemOptions, IdentityProvider...)
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder.setIdentityRepositoryFactory(FileSystemOptions, IdentityRepositoryFactory)
- org.apache.commons.vfs2.provider.sftp.SftpFileSystemConfigBuilder.setKnownHosts(FileSystemOptions, File)
- org.apache.commons.vfs2.provider.local.LocalFile.LocalFile(LocalFileSystem, String, AbstractFileName)
- org.apache.commons.vfs2.provider.tar.TarFileObject.TarFileObject(AbstractFileName, TarArchiveEntry, TarFileSystem, boolean)
- org.apache.commons.vfs2.provider.tar.TarFileSystem.createTarFileObject(AbstractFileName, TarArchiveEntry)
- org.apache.commons.vfs2.provider.zip.ZipFileObject.ZipFileObject(AbstractFileName, ZipEntry, ZipFileSystem, boolean)
- org.apache.commons.vfs2.provider.http4.Http4FileProvider.createHttpClientContext()
- org.apache.commons.vfs2.provider.http5.Http5FileProvider.createHttpClientContext()
- org.apache.commons.vfs2.provider.http4.Http4FileObject.getInternalURI()
- org.apache.commons.vfs2.provider.http5.Http5FileObject.getInternalURI()
</action>
<!-- UPDATES -->
<action type="update" dev="ggregory" due-to="Gary Gregory">
Bump Log4j 2.14.0 -> 2.14.1.

0 comments on commit c4e381d

Please sign in to comment.