KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > vfs > VFSMount


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.vfs;
21
22 import java.io.IOException JavaDoc;
23
24 import org.apache.commons.vfs.FileObject;
25
26 import com.sslexplorer.security.PasswordCredentials;
27 import com.sslexplorer.vfs.webdav.DAVAuthenticationRequiredException;
28 import com.sslexplorer.vfs.webdav.DAVTransaction;
29
30 /**
31  * Implementations of this interface provide the root
32  * of a single configured <i>Mount</i> to some file system specific file system.
33  * <p>
34  * The mount is responsible for creating {@link com.sslexplorer.vfs.VFSResource}
35  * objects suitable for the file system.
36  *
37  * @author Brett Smith <brett@3sp.com>
38  */

39 public interface VFSMount {
40     
41     /**
42      * Get the store from which this mount was created.
43      *
44      * @return store
45      */

46     public VFSStore getStore();
47     
48     /**
49      * Get a resource given its path relative to this mount. To get the
50      * root resource supply an empty string as the path.
51      *
52      * @param path path of resource
53      * @param requestCredentials request credentials
54      * @return resource
55      * @throws IOException on any error
56      */

57     public VFSResource getResource(String JavaDoc path, PasswordCredentials requestCredentials) throws IOException JavaDoc;
58     
59     /**
60      * Return the pathname for this mount. It must have a trailing slash (/)
61      * and be encoded.
62      *
63      * @return mount string
64      */

65     public String JavaDoc getMountString();
66     
67     
68     /**
69      * Get if this mount is read only.
70      *
71      * @return read only
72      */

73     public boolean isReadOnly();
74     
75     /**
76      * Create a file object.
77      *
78      * @param path path
79      * @param requestCredentials credentials
80      * @return file object
81      * @throws IOException on any error
82      * @throws DAVAuthenticationRequiredException
83      */

84     public FileObject createAuthenticatedVFSFileObject(String JavaDoc path, PasswordCredentials requestCredentials) throws IOException JavaDoc, DAVAuthenticationRequiredException;
85     
86     /**
87      * Invoked when a resource is copied from this mount. If the copy failed
88      * then a non-null exception will provided
89      *
90      * @param resource resource
91      * @param destination destination resource
92      * @param transaction transaction
93      * @param exception any error or <code>null</code> if succesful
94      */

95     public void resourceCopy(VFSResource resource, VFSResource destination, DAVTransaction transaction, Throwable JavaDoc exception);
96     
97     /**
98      * Invoked when a resource is deleted from this mount. If the delete failed
99      * then a non-null exception will provided
100      *
101      * @param resource resource
102      * @param transaction transaction
103      * @param exception any error or <code>null</code> if succesful
104      */

105     public void resourceDelete(VFSResource resource, DAVTransaction transaction, Throwable JavaDoc exception);
106     
107     /**
108      * Invoked when a collection resource is listed from this mount. If the access failed
109      * then a non-null exception will provided
110      *
111      * @param resource resource
112      * @param transaction transaction
113      * @param exception any error or <code>null</code> if succesful
114      */

115     public void resourceAccessList(VFSResource resource, DAVTransaction transaction, Throwable JavaDoc exception);
116
117     /**
118      * Invoked when a download of a resource from this mount starts.
119      *
120      * @param resource resource
121      * @param transaction transaction
122      */

123     public void resourceAccessDownloading(VFSResource resource, DAVTransaction transaction);
124     
125     /**
126      * Invoked when a download of a resource from this mount starts.
127      *
128      * @param resource resource
129      * @param transaction transaction
130      * @param exception any error or <code>null</code> if succesful
131      */

132     public void resourceAccessDownloadComplete(VFSResource resource, DAVTransaction transaction, Throwable JavaDoc exception);
133     
134     /**
135      * Invoked when a collection resource is created
136      *
137      * @param resource resource
138      * @param transaction transaction
139      * @param exception any error or <code>null</code> if succesful
140      */

141     public void resourceCollectionCreated(VFSResource resource, DAVTransaction transaction, Throwable JavaDoc exception);
142
143     /**
144      * Invoked when a resource is moved
145      *
146      * @param resource resource
147      * @param destination destination
148      * @param transaction transaction
149      * @param exception any error or <code>null</code> if succesful
150      */

151     public void resourceMoved(VFSResource resource, VFSResource destination, DAVTransaction transaction, Throwable JavaDoc exception);
152
153     /**
154      * Invoked when a resource is uploaded
155      *
156      * @param resource resource
157      * @param transaction transaction
158      * @param exception any error or <code>null</code> if succesful
159      */

160     public void resourceUpload(VFSResource resource, DAVTransaction transaction, Throwable JavaDoc exception);
161 }
162
Popular Tags