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.mime;
22
23 import org.millscript.commons.vfs.VFile;
24 import org.millscript.commons.vfs.VFolder;
25 import org.millscript.commons.vfs.VVolume;
26
27 /**
28 * This interface specifies a virtual filesystem MIME type handler, for
29 * resolving a specified MIME type into a new virtual filesystem object.
30 */
31 public interface MIMETypeHandler {
32
33 /**
34 * Resolves the specified VFile to a virtual file in a new virtual
35 * filesystem. The returned virtual file will belong to a virtual volume
36 * and possibly some virtual folders as well. This is achieved by decoding
37 * the file into a virtual file on a new volume.
38 *
39 * @param file the VFile to make the root volume from
40 * @return a VFile for the specified file URI
41 */
42 VFile resolveAsFile( final VFile file );
43
44 /**
45 * Resolves the specified VFile to a virtual folder in a new virtual
46 * filesystem. The returned virtual fiolder will belong to a virtual volume
47 * and possibly some virtual folders as well. This is achieved by decoding
48 * the file into a new volume and returning the new volumes root folder.
49 *
50 * @param file the VFile to make the folders root volume from
51 * @return a VFolder for the specified file
52 */
53 VFolder resolveAsFolder( final VFile file );
54
55 /**
56 * Resolves the specified VFile to a new virtual filesystem volume. This is
57 * achieved by decoding the file as an archive, as is appropriate for this
58 * MIME type handler. The root of the virtual volume will be the root of
59 * decoded archive.
60 *
61 * @param file the VFile to make the root volume from
62 * @return a VVolume for the specified file
63 */
64 VVolume resolveAsVolume( final VFile file );
65
66 }