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 2005/10/18 19:45:23 UTC
svn commit: r326181 -
/jakarta/commons/proper/vfs/trunk/src/examples/org/apache/commons/vfs/libcheck/FtpCheck.java
Author: imario
Date: Tue Oct 18 10:45:18 2005
New Revision: 326181
URL: http://svn.apache.org/viewcvs?rev=326181&view=rev
Log:
ftp: check create file (test.txt)
Modified:
jakarta/commons/proper/vfs/trunk/src/examples/org/apache/commons/vfs/libcheck/FtpCheck.java
Modified: jakarta/commons/proper/vfs/trunk/src/examples/org/apache/commons/vfs/libcheck/FtpCheck.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/vfs/trunk/src/examples/org/apache/commons/vfs/libcheck/FtpCheck.java?rev=326181&r1=326180&r2=326181&view=diff
==============================================================================
--- jakarta/commons/proper/vfs/trunk/src/examples/org/apache/commons/vfs/libcheck/FtpCheck.java (original)
+++ jakarta/commons/proper/vfs/trunk/src/examples/org/apache/commons/vfs/libcheck/FtpCheck.java Tue Oct 18 10:45:18 2005
@@ -19,6 +19,8 @@
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPReply;
+import java.io.OutputStream;
+
/**
* Basic check for sftp
*/
@@ -51,6 +53,16 @@
throw new IllegalArgumentException("login failed");
}
client.enterLocalPassiveMode();
+
+ OutputStream os = client.storeFileStream(dir + "/test.txt");
+ if (os == null)
+ {
+ throw new IllegalStateException(client.getReplyString());
+ }
+ os.write("test".getBytes());
+ os.close();
+ client.completePendingCommand();
+
if (dir != null)
{
if (!client.changeWorkingDirectory(dir))
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org