diff options
author | chrismair <chrismair@531de8e6-9941-0410-b38b-9a92acbe0330> | 2010-03-26 02:06:24 +0000 |
---|---|---|
committer | chrismair <chrismair@531de8e6-9941-0410-b38b-9a92acbe0330> | 2010-03-26 02:06:24 +0000 |
commit | 0b0a54fe829a473e1773eac35609aa3eb01fbea9 (patch) | |
tree | 253dc488b3bd0cf1f825f8ae42cbc98137748580 | |
parent | a5ff87feb19f5ff748fd4375b108d8be4a18686b (diff) | |
download | mockftpserver-0b0a54fe829a473e1773eac35609aa3eb01fbea9.tar.gz |
Add example code for fileSystem.getEntry() and createInputStream()
git-svn-id: svn://svn.code.sf.net/p/mockftpserver/code@250 531de8e6-9941-0410-b38b-9a92acbe0330
-rw-r--r-- | MockFtpServer/src/site/apt/fakeftpserver-filesystems.apt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/MockFtpServer/src/site/apt/fakeftpserver-filesystems.apt b/MockFtpServer/src/site/apt/fakeftpserver-filesystems.apt index 60833a3..e40a9e8 100644 --- a/MockFtpServer/src/site/apt/fakeftpserver-filesystems.apt +++ b/MockFtpServer/src/site/apt/fakeftpserver-filesystems.apt @@ -207,6 +207,24 @@ FakeFtpServer Filesystems "permissionsFromString" shortcut method. Either way is fine -- use whichever method you prefer on
both files and directories.
+ []
+
+ When you want to retrieve and/or verify the contents of the <<<FakeFtpServer>>> filesystem, you can use
+ the <<<FileSystem#getEntry(String path)>>> method, as shown in the following code.
+
++------------------------------------------------------------------------------
+ DirectoryEntry dirEntry = (DirectoryEntry)fileSystem.getEntry("c:/data");
+
+ FileEntry fileEntry = (FileEntry)fileSystem.getEntry("c:/data/file1.txt");
+
+ FileEntry newFileEntry = (FileEntry)fileSystem.getEntry("c:/data/new.txt");
+ InputStream inputStream = newFileEntry.createInputStream();
+ // read the file contents using inputStream
++------------------------------------------------------------------------------
+
+ See the javadoc for <<<FileSystem>>>, <<<FileEntry>>> and <<<DirectoryEntry>>> for more information
+ on the methods available.
+
** Example Using Spring Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|