commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r328440 - in /jakarta/commons/proper/vfs/trunk: ./ RELEASE_NOTES.txt src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java src/java/org/apache/commons/vfs/provider/sftp/SftpFileSystemConfigBuilder.java
Date Tue, 25 Oct 2005 17:54:06 GMT
Author: imario
Date: Tue Oct 25 10:53:57 2005
New Revision: 328440

URL: http://svn.apache.org/viewcvs?rev=328440&view=rev
Log:
sftp: new configuration option "timeout"

Modified:
    jakarta/commons/proper/vfs/trunk/   (props changed)
    jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java
    jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpFileSystemConfigBuilder.java

Propchange: jakarta/commons/proper/vfs/trunk/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Oct 25 10:53:57 2005
@@ -1,3 +1,4 @@
+
 .project
 target
 dist
@@ -5,3 +6,7 @@
 *.log
 build.properties
 .classpath
+vfs_cache
+mytests
+junit*.properties
+javadoc*

Modified: jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt?rev=328440&r1=328439&r2=328440&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt (original)
+++ jakarta/commons/proper/vfs/trunk/RELEASE_NOTES.txt Tue Oct 25 10:53:57 2005
@@ -1,5 +1,8 @@
 2005-11 comons-vfs 1.0 RC6
 
+sftp:
+new configuration parameter SftpFileSystemConfigBuilder.timeout
+
 ftp:
 better error message if it isnt possible to aquire a input or output stream
 

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java?rev=328440&r1=328439&r2=328440&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpClientFactory.java
Tue Oct 25 10:53:57 2005
@@ -130,6 +130,12 @@
                     port);
             session.setPassword(password);
 
+            Integer timeout = SftpFileSystemConfigBuilder.getInstance().getTimeout(fileSystemOptions);
+            if (timeout != null)
+            {
+            	session.setTimeout(timeout.intValue());
+            }
+            
             UserInfo userInfo = SftpFileSystemConfigBuilder.getInstance().getUserInfo(fileSystemOptions);
             if (userInfo != null)
             {

Modified: jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpFileSystemConfigBuilder.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpFileSystemConfigBuilder.java?rev=328440&r1=328439&r2=328440&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpFileSystemConfigBuilder.java
(original)
+++ jakarta/commons/proper/vfs/trunk/src/java/org/apache/commons/vfs/provider/sftp/SftpFileSystemConfigBuilder.java
Tue Oct 25 10:53:57 2005
@@ -33,6 +33,7 @@
     private final static SftpFileSystemConfigBuilder builder = new SftpFileSystemConfigBuilder();
 
     private final static String USER_DIR_IS_ROOT = SftpFileSystemConfigBuilder.class.getName()
+ ".USER_DIR_IS_ROOT";
+    private final static String TIMEOUT = SftpFileSystemConfigBuilder.class.getName() + ".TIMEOUT";
 
     public static SftpFileSystemConfigBuilder getInstance()
     {
@@ -183,6 +184,27 @@
         return (Boolean) getParam(opts, USER_DIR_IS_ROOT);
     }
 
+    /**
+     * set the timeout value on jsch session
+     *
+     * @param opts
+     * @param userDirIsRoot
+     */
+    public void setTimeout(FileSystemOptions opts, Integer timeout)
+    {
+        setParam(opts, TIMEOUT, timeout);
+    }
+
+    /**
+     * @param opts
+     * @return
+     * @see #setTimeout
+     */
+    public Integer getTimeout(FileSystemOptions opts)
+    {
+        return (Integer) getParam(opts, TIMEOUT);
+    }
+    
     protected Class getConfigClass()
     {
         return SftpFileSystem.class;



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message