You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by im...@apache.org on 2004/08/26 18:40:03 UTC
cvs commit: jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/sftp SftpFileSystem.java SftpFileSystemConfigBuilder.java
imario 2004/08/26 09:40:03
Modified: vfs/src/java/org/apache/commons/vfs/provider/sftp
SftpFileSystem.java
SftpFileSystemConfigBuilder.java
Log:
configure jsch compression
Revision Changes Path
1.14 +20 -1 jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/sftp/SftpFileSystem.java
Index: SftpFileSystem.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/sftp/SftpFileSystem.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- SftpFileSystem.java 4 Jul 2004 18:45:56 -0000 1.13
+++ SftpFileSystem.java 26 Aug 2004 16:40:02 -0000 1.14
@@ -28,6 +28,7 @@
import java.io.IOException;
import java.util.Collection;
+import java.util.Hashtable;
/**
* Represents the files on an SFTP server.
@@ -84,6 +85,24 @@
rootName.getUserName(),
rootName.getPassword(),
getFileSystemOptions());
+
+ Hashtable config = null;
+
+ String compression = SftpFileSystemConfigBuilder.getInstance().getCompression(getFileSystemOptions());
+ if (compression != null)
+ {
+ if (config == null)
+ {
+ config = new Hashtable();
+ }
+ config.put("compression.c2s", compression);
+ config.put("compression.s2c", compression);
+ }
+
+ if (config != null)
+ {
+ session.setConfig(config);
+ }
}
catch (final Exception e)
{
1.6 +25 -1 jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/sftp/SftpFileSystemConfigBuilder.java
Index: SftpFileSystemConfigBuilder.java
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/vfs/src/java/org/apache/commons/vfs/provider/sftp/SftpFileSystemConfigBuilder.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- SftpFileSystemConfigBuilder.java 24 May 2004 20:11:21 -0000 1.5
+++ SftpFileSystemConfigBuilder.java 26 Aug 2004 16:40:02 -0000 1.6
@@ -98,6 +98,30 @@
}
/**
+ * configure the compression to use.<br>
+ * e.g. pass "zlib,none" to enable the compression.<br>
+ * See the jsch documentation for details.
+ *
+ * @param opts
+ * @param compression
+ * @throws FileSystemException
+ */
+ public void setCompression(FileSystemOptions opts, String compression) throws FileSystemException
+ {
+ setParam(opts, "compression", compression);
+ }
+
+ /**
+ * @param opts
+ * @return
+ * @see #setCompression
+ */
+ public String getCompression(FileSystemOptions opts)
+ {
+ return (String) getParam(opts, "compression");
+ }
+
+ /**
* @param opts
* @return
* @see #setIdentities
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org