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/03/20 23:18:49 UTC

[commons-vfs] branch master updated (e819f5d -> 42fc7ad)

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

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


    from e819f5d  Trying fix for failing builds on GitHub.
     new 29fe31a  Format.
     new 42fc7ad  Set timeouts in tests to try and fix GitHub builds.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/commons/vfs2/provider/sftp/SftpFileSystem.java   | 13 ++++++-------
 .../vfs2/provider/sftp/AbstractSftpProviderTestCase.java    |  4 ++++
 2 files changed, 10 insertions(+), 7 deletions(-)

[commons-vfs] 01/02: Format.

Posted by gg...@apache.org.
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-vfs.git

commit 29fe31a35c5c323d1388bda915171648910cec80
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Mar 20 19:17:04 2021 -0400

    Format.
---
 .../apache/commons/vfs2/provider/sftp/SftpFileSystem.java   | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
index 7b366b2..2c6778b 100644
--- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
+++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystem.java
@@ -89,11 +89,10 @@ public class SftpFileSystem extends AbstractFileSystem {
     private final boolean execDisabled;
 
     protected SftpFileSystem(final GenericFileName rootName, final Session session,
-            final FileSystemOptions fileSystemOptions) {
+        final FileSystemOptions fileSystemOptions) {
         super(rootName, null, fileSystemOptions);
         this.session = Objects.requireNonNull(session, "session");
-        this.connectTimeout = SftpFileSystemConfigBuilder.getInstance()
-            .getConnectTimeout(fileSystemOptions);
+        this.connectTimeout = SftpFileSystemConfigBuilder.getInstance().getConnectTimeout(fileSystemOptions);
 
         if (SftpFileSystemConfigBuilder.getInstance().isDisableDetectExecChannel(fileSystemOptions)) {
             this.execDisabled = true;
@@ -142,20 +141,20 @@ public class SftpFileSystem extends AbstractFileSystem {
                 channel = (ChannelSftp) getSession().openChannel("sftp");
                 channel.connect(DurationUtils.toMillisInt(connectTimeout));
                 final Boolean userDirIsRoot = SftpFileSystemConfigBuilder.getInstance()
-                        .getUserDirIsRoot(getFileSystemOptions());
+                    .getUserDirIsRoot(getFileSystemOptions());
                 final String workingDirectory = getRootName().getPath();
                 if (workingDirectory != null && (userDirIsRoot == null || !userDirIsRoot.booleanValue())) {
                     try {
                         channel.cd(workingDirectory);
                     } catch (final SftpException e) {
                         throw new FileSystemException("vfs.provider.sftp/change-work-directory.error", workingDirectory,
-                                e);
+                            e);
                     }
                 }
             }
 
             final String fileNameEncoding = SftpFileSystemConfigBuilder.getInstance()
-                    .getFileNameEncoding(getFileSystemOptions());
+                .getFileNameEncoding(getFileSystemOptions());
 
             if (fileNameEncoding != null) {
                 try {
@@ -181,7 +180,7 @@ public class SftpFileSystem extends AbstractFileSystem {
                 if (!this.session.isConnected()) {
                     doCloseCommunicationLink();
                     this.session = SftpFileProvider.createSession((GenericFileName) getRootName(),
-                            getFileSystemOptions());
+                        getFileSystemOptions());
                 }
             }
         }

[commons-vfs] 02/02: Set timeouts in tests to try and fix GitHub builds.

Posted by gg...@apache.org.
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-vfs.git

commit 42fc7ad592b3835a3e42c89f0bc6812e248ae68e
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sat Mar 20 19:18:46 2021 -0400

    Set timeouts in tests to try and fix GitHub builds.
---
 .../commons/vfs2/provider/sftp/AbstractSftpProviderTestCase.java      | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/AbstractSftpProviderTestCase.java b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/AbstractSftpProviderTestCase.java
index 9392379..64428b7 100644
--- a/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/AbstractSftpProviderTestCase.java
+++ b/commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/sftp/AbstractSftpProviderTestCase.java
@@ -24,6 +24,7 @@ import java.io.OutputStream;
 import java.io.PrintStream;
 import java.net.InetSocketAddress;
 import java.net.Socket;
+import java.time.Duration;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.TreeMap;
@@ -303,6 +304,9 @@ abstract class AbstractSftpProviderTestCase extends AbstractProviderTestConfig {
         builder.setStrictHostKeyChecking(fileSystemOptions, "no");
         builder.setUserInfo(fileSystemOptions, new TrustEveryoneUserInfo());
         builder.setIdentityRepositoryFactory(fileSystemOptions, new TestIdentityRepositoryFactory());
+        builder.setConnectTimeout(fileSystemOptions, Duration.ofSeconds(60));
+        builder.setSessionTimeout(fileSystemOptions, Duration.ofSeconds(60));
+
         final FileObject fileObject = manager.resolveFile(uri, fileSystemOptions);
         this.fileSystem = (SftpFileSystem) fileObject.getFileSystem();
         return fileObject;