Sunday, December 21, 2014

FTP and WebDAV Plugins for Pharo's FileSystem

Project info

The “FileSystemNetwork” project is a small library which adds WebDAV and FTP support to Pharo’s FileSystem framework. This allows you to use remote WebDAV and FTP locations with the same (FileSystem) API that’s used for disk access.

Project location

The project is located on STHub at!/~UdoSchneider/FileSystemNetwork


Because the Pharo Tools use FileSystem as their underlying framework even those built-in tools are now able to use remote WebDAV and FTP locations.
Pharo FileList browser on FTP Server


To install everything (WebDAV, FTP and tests) simply use:

Gofer it
    smalltalkhubUser: 'UdoSchneider' project: 'FileSystemNetwork';

If you don’t want to load everything the configuration provides (two) three groups:

  • Webdav: (Only WebDav - no tests)
  • FTP: (Only FTP - no tests)
  • Tests: (All tests - loads everything)

E.g. to only load WebDAV support use

Gofer it
    smalltalkhubUser: 'UdoSchneider' project: 'FileSystemNetwork';
#ConfigurationOfFileSystemNetwork asClass project stableVersion load: 'Webdav'

Use in your own application

Once loaded the FileSystem class provides additional methods (#webdav: and #ftp:) which return a Network filesystem. Both methods take a String or (Zn)Url argument which allows you to specify username, password, host, port and initial working directory (e.g. [scheme]://[username]:[password]@[hostname]:[port][workingdirectory]. Once you obtained the FileSystem you can use the usual FileSystem API (see Files with FileSystem for examples).

NOTE: Please remember to always #close the FileSystem instance. There might be dangling/open instances otherwise!


"Obtain a FTP FileSystem"
fs := FileSystem ftp: ''.

"Get working directory"
wd := fs workingDirectory .

"Print the following expression!"
(wd / 'pub' / 'firefox') children.

"Open a FileList on the FileSystem"
FileList openOn: wd.

"Remember to close if you are finished!"
fs close.


"Obtain a WebDAV FileSystem"
fs := FileSystem webdav: ''.

"Get working directory"
wd := fs workingDirectory.

"Open a FileList on the FileSystem"
FileList openOn: wd.

"Remember to close if you are finished!"
fs close.


  • FileSystem-Network-Core - package with core/protocol independent functionality
  • FileSystem-Tests-Network-Core - package with core tests
  • FileSystem-Network-FTP - package with FTP functionality
  • FileSystem-Tests-Network-FTP - package with FTP tests
  • FileSystem-Network-Webdav - package with WebDAV functionality
  • FileSystem-Tests-Network-Webdav - package with WebDAV tests


The package comes with 156 tests in the test packages (most of them inherited from FileSystem tests). All tests are green on the clients/servers I used.

NOTE If you want to verify that a certain server works correctly simply run the tests against this server. Please remember that you need write access for the tests to be successful.

NOTE The server URLs for WebDAV and FTP are not hardcoded in the tests. You will be requested to provide FTP and WebDAV URLs on first run. If you want to reset the cached URLs use FTPFileSystemTest reset.and WebdavFileSystemTest reset..

To Do

Enhanced FTP Server Support

Currently only FTP Servers running on *nix or Windows are supported. Support for NetWare and Rumpus are on the way.

S3 Support

Amazon S3 Support will be integrated soon as most of the functionality is already there due to the WebDAV/HTTP support.


The code is under MIT License.


roman said...

Hello! May I help you with S3 implemention?

Udo Schneider said...

Hi Roman,

S3 should already be implemented (although I forgot to update the Blog entry).

Loading the most recent configuration from Smalltalk Hub should also load the S3 stuff.

So it is implemented but I would love to get some feedback on it, whether it works in your case.



duetto said...


any chance that this could be ported to dolphin? if not, can i get the ftp stuff in zip or pac format?



Udo Schneider said...

Hi John,

porting the full package to Dolphin might not be easy as a lot of the code relies on Pharo's FileSystem Framework (where my stuff is just a plugin to). The basic low-level stuff relies on Zinc-HTTP and XML Parser. IMHO it should be possible to port this to HTTPClient and IXMLDocument - never tried it though.



Udo Schneider said...

I'll try to extract the FTP stuff for you.

duetto said...

thanks udo