commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject svn commit: r326181 - /jakarta/commons/proper/vfs/trunk/src/examples/org/apache/commons/vfs/libcheck/FtpCheck.java
Date Tue, 18 Oct 2005 17:45:23 GMT
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


Mime
View raw message