1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.millscript.commons.vfs.protocols;
22
23 import org.millscript.commons.vfs.VFS;
24 import org.millscript.commons.vfs.VFile;
25 import org.millscript.commons.vfs.VFolder;
26 import org.millscript.commons.vfs.VVolume;
27
28 import java.net.URI;
29
30 /**
31 * This interface specifies a virtual filesystem URI scheme handler, for
32 * resolving a specified URI into a new virtual filesystem object.
33 */
34 public interface URISchemeHandler {
35
36 /**
37 * Returns the parent VFS, that which created this URI scheme handler. The
38 * parent VFS is maintained through to each volume, so that we can use it
39 * for configuration.
40 *
41 * @return
42 */
43 VFS getParentVFS();
44
45 /**
46 * Resolves the specified URI to a virtual file in a new virtual
47 * filesystem. The returned virtual file will belong to a virtual volume
48 * and possibly some virtual folders as well. The virtual volume will be
49 * located at the root of the URI's path.
50 *
51 * @param uri the URI of the file to get a virtual file for
52 * @return a VFile for the specified file URI
53 */
54 VFile resolveAsFile( final URI uri );
55
56 /**
57 * Resolves the specified URI to a virtual fole in a new virtual
58 * filesystem. The returned virtual fiolder will belong to a virtual volume
59 * and possibly some virtual folders as well. The virtual volume will be
60 * located at the root of the URI's path.
61 *
62 * @param uri the URI of the folder to get a virtual folder for
63 * @return a VFile for the specified folder URI
64 */
65 VFolder resolveAsFolder( final URI uri );
66
67 /**
68 * Resolves the specified URI to a new virtual filesystem volume. The root
69 * of the virtual volume will be the specified URI's path.
70 *
71 * @param uri the URI of the file to get a virtual file for
72 * @return a VFile for the specified file URI
73 */
74 VVolume resolveAsVolume( final URI uri );
75
76 }