KickJava   Java API By Example, From Geeks To Geeks.

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


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.util.Collection JavaDoc;
23
24 import com.sslexplorer.policyframework.LaunchSession;
25 import com.sslexplorer.vfs.utils.URI;
26 import com.sslexplorer.vfs.webdav.DAVException;
27
28 /**
29  * A store is a child of a {@link com.sslexplorer.vfs.VFSRepository}
30  * and provides the entry point for a particular type of file system
31  * (e.g. Local, SMB, FTP etc).
32  * <p>
33  * It returns a list of {@link com.sslexplorer.vfs.VFSMount} objects
34  * appropriate for the file system and the users security policy.
35  * <p>
36  * Either the core or plugins may register new store implementations using
37  * {@link com.sslexplorer.vfs.VFSProviderManager#registerStore(Class)}.
38  *
39  * @author Brett Smith <brett@3sp.com>
40  * @see com.sslexplorer.vfs.VFSProviderManager
41  */

42 public interface VFSStore {
43
44     /**
45      * Get the root resource for this store.
46      *
47      * @return root resource resource
48      * @throws DAVException on any error
49      */

50     public VFSResource getStoreResource() throws DAVException;
51
52     /**
53      * Get the name of this name
54      *
55      * @return store name
56      */

57     public String JavaDoc getName();
58     
59     /**
60      * Get the provider for this store instance. This will only
61      * be available after the store has been initialised.
62      *
63      * @return provider
64      */

65     public VFSProvider getProvider();
66
67     /**
68      * Initialise the store
69      *
70      * @param repository repository
71      * @param provider provider
72      */

73     public void init(VFSRepository repository, VFSProvider provider);
74
75     /**
76      * Get the repository that initialised this store. This will only
77      * be available after the store has been initialised.
78      *
79      * @return response
80      */

81     public VFSRepository getRepository();
82
83     /**
84      * Get a mount object given its name name. The mount name should be the name
85      * of the mount only (no leading or trailing slashes). <code>null</code>
86      * will be returned if no such mount exists.
87      *
88      * @param mountString mount string
89      * @param launchSession launch session
90      * @return mount
91      * @throws DAVException on any error.
92      */

93     public VFSMount getMountFromString(String JavaDoc mountString, LaunchSession launchSession) throws DAVException;
94     
95     /**
96      * Get the mount path name for a given mount. The store path
97      * will be prepended to the supplied mount name.
98      *
99      * @param mountName mount name
100      * @return mount path
101      */

102     public String JavaDoc getMountPath(String JavaDoc mountName);
103
104     /**
105      * Get a list of all the available mount names
106      *
107      * @return iterator of appropriate mounts
108      * @throws Exception on any error
109      */

110     public Collection JavaDoc<String JavaDoc> getMountNames() throws Exception JavaDoc;
111
112     /**
113      * Get the guest username to use for this store / transaction
114      *
115      * @return guest username
116      * @see #getGuestPassword
117      */

118     public String JavaDoc getGuestUsername();
119
120     /**
121      * Get the guest password to use for this store / transaction
122      *
123      * @return guest password
124      * @see #getGuestUsername
125      */

126     public char[] getGuestPassword();
127
128     /**
129      * Get the encoding.
130      *
131      * @return encoding
132      */

133     public String JavaDoc getEncoding();
134
135 }
136
Popular Tags