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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]