KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > jayasoft > ivy > repository > vfs > IvyWebdavFileProvider


1 package fr.jayasoft.ivy.repository.vfs;
2
3 import org.apache.commons.httpclient.HttpClient;
4 import org.apache.commons.vfs.FileName;
5 import org.apache.commons.vfs.FileSystem;
6 import org.apache.commons.vfs.FileSystemException;
7 import org.apache.commons.vfs.FileSystemOptions;
8 import org.apache.commons.vfs.provider.GenericFileName;
9 import org.apache.commons.vfs.provider.webdav.WebdavFileProvider;
10
11 /**
12  * Modified version of the WebdavFileProvider from VFS which adds support for httpclient 3.x.
13  * See http://issues.apache.org/jira/browse/VFS-74 for more info.
14  *
15  * A provider for WebDAV.
16  *
17  * @author <a HREF="mailto:adammurdoch@apache.org">Adam Murdoch</a>
18  * @author Maarten Coene
19  * @version $Revision: 417178 $ $Date: 2006-06-26 05:31:41 -0700 (Mon, 26 Jun 2006) $
20  */

21 public class IvyWebdavFileProvider extends WebdavFileProvider {
22
23     /***********************************************************************************************
24      * Creates a filesystem.
25      */

26     protected FileSystem doCreateFileSystem(final FileName name,
27             final FileSystemOptions fileSystemOptions) throws FileSystemException {
28         // Create the file system
29
final GenericFileName rootName = (GenericFileName) name;
30
31         HttpClient httpClient = IvyWebdavClientFactory.createConnection(rootName.getHostName(),
32                 rootName.getPort(), rootName.getUserName(), rootName.getPassword(),
33                 fileSystemOptions);
34
35         return new IvyWebdavFileSystem(rootName, httpClient, fileSystemOptions);
36     }
37
38 }
39
Popular Tags