1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package org.archive.util.ms;
24
25 import java.io.IOException;
26
27 import org.archive.io.SeekInputStream;
28
29
30 /***
31 * Describes the internal file system contained in .doc files.
32 */
33 public interface BlockFileSystem {
34
35
36 /***
37 * The size of a block in bytes.
38 */
39 int BLOCK_SIZE = 512;
40
41
42 /***
43 * Returns the root entry of the file system. Subfiles and directories
44 * can be found by searching the returned entry.
45 *
46 * @return the root entry
47 * @throws IOException if an IO error occurs
48 */
49 public abstract Entry getRoot() throws IOException;
50
51
52 /***
53 * Returns the number of the block that follows the given block.
54 * The internal block allocation tables are consulted to determine the
55 * next block. A return value that is less than zero indicates that
56 * there is no next block.
57 *
58 * @param block the number of block whose successor to return
59 * @return the successor of that block
60 * @throws IOException if an IO error occurs
61 */
62 public abstract int getNextBlock(int block) throws IOException;
63
64
65 /***
66 * Returns the raw input stream for this file system.
67 * Typically this will be the random access file containing the .doc.
68 *
69 * @return the raw input stream for this file system
70 */
71 public abstract SeekInputStream getRawInput();
72
73 }