|
Navigation
Main
How To
File System Documentation
Use Cases
|
|
POIFS Use Cases |
Use Case 1: Read existing file system |
Primary Actor: |
POIFS client |
Scope: |
POIFS |
Level: |
Summary |
Stakeholders and Interests: |
- POIFS client- wants to read content of file
system
- POIFS - understands POIFS file system
|
Precondition: |
None |
Minimal Guarantee: |
None |
Main Success Guarantee: |
- POIFS client requests POIFS to read a POIFS file
system, providing an
InputStream
containing POIFS file system in question.
- POIFS reads from the
InputStream in
512 byte blocks
- POIFS verifies that the first block begins with
the well known signature
(
0xE11AB1A1E011CFD0 )
- POIFS reads the Block Allocation Table from the
first block and, if necessary, from the XBAT
blocks.
- POIFS obtains the start block of the Property
Table and reads the Property Table (use case 9,
read file)
- POIFS reads the individual entries in the Property
Table
- POIFS obtains the start block of the Small Block
Allocation Table and reads the Small Block
Allocation Table (use case 9, read file)
- POIFS obtains the start block of the Small Block
store from the first entry in the Property Table
and reads the Small Block Array (use case 9, read
file)
|
Extensions: |
- 2a. If the last block read is not a 512 byte
block, the
InputStream is not that of
a POIFS file system, and POIFS throws an
appropriate exception.
- 3a. If the signature is incorrect, the
InputStream is not that of a POIFS
file system, and POIFS throws an appropriate
exception.
|
|
Use Case 2: Write file system |
Primary Actor: |
POIFS client |
Scope: |
POIFS |
Level: |
Summary |
Stakeholders and Interests: |
- POIFS client- wants to write file system out.
- POIFS - knows how to write file system out.
|
Precondition: |
- File system has been read (use case 1, read
existing file system) and subsequently modified
(use case 4, replace file in file system; use case
5, delete file from file system; or use case 6,
write new file to file system; in any
combination)
or
- File system has been created (use case 3, create
new file system)
|
Minimal Guarantee: |
None |
Main Success Guarantee: |
- POIFS client provides an
OutputStream
to write the file system to.
- POIFS gets the sizes of the Property Table and
each file in the file system.
- If any files in the file system requires storage
in a Small Block Array, POIFS creates a Small
Block Array of sufficient size to hold all of the
small files.
- POIFS calculates the number of big blocks needed
to hold all of the large files, the Property
Table, and, if necessary, the Small Block Array
and the Small Block Allocation Table.
- POIFS creates a set of big blocks sufficient to
store the Block Allocation Table
- POIFS creates and writes the header block
- POIFS writes out the XBAT blocks, if needed.
- POIFS writes out the Small Block Array, if
needed
- POIFS writes out the Small Block Allocation Table,
if needed
- POIFS writes out the Property Table
- POIFS writes out the large files, if needed
- POIFS closes the
OutputStream .
|
Extensions: |
- 6a. Exceptions writing to the
OutputStream will be propagated back
to the POIFS client.
- 7a. Exceptions writing to the
OutputStream will be propagated back
to the POIFS client.
- 8a. Exceptions writing to the
OutputStream will be propagated back
to the POIFS client.
- 9a. Exceptions writing to the
OutputStream will be propagated back
to the POIFS client.
- 10a. Exceptions writing to the
OutputStream will be propagated back
to the POIFS client.
- 11a. Exceptions writing to the
OutputStream will be propagated back
to the POIFS client.
- 12a. Exceptions closing the
OutputStream will be propagated back
to the POIFS client.
|
|
Use Case 3: Create new file system |
Primary Actor: |
POIFS client |
Scope: |
POIFS |
Level: |
Summary |
Stakeholders and Interests: |
- POIFS client- wants to create a new file
system
- POIFS - knows how to create a new file system
|
Precondition: |
None |
Minimal Guarantee: |
None |
Main Success Guarantee: |
- POIFS creates an empty Property Table.
|
Extensions: |
None |
|
Use Case 4: Replace file in file system |
Primary Actor: |
POIFS client |
Scope: |
POIFS |
Level: |
Summary |
Stakeholders and Interests: |
- POIFS client- wants to replace an existing file in
the file system
- POIFS - knows how to manage the file system
|
Precondition: |
Either
- The file system has been read (use case 1, read
existing file system) and a file has been
extracted from the file system (use case 7, read
existing file from file system)
or
- The file system has been created (use case 3,
create new file system) and a file has been
written to the file system (use case 6, write new
file to file system)
|
Minimal Guarantee: |
None |
Main Success Guarantee: |
- POIFS discards storage of the existing file.
- POIFS updates the existing file's entry in the
Property Table
- POIFS stores the new file's data
|
Extensions: |
- 1a. POIFS throws an exception if the file does not
exist.
|
|
Use Case 5: Delete file from file system |
Primary Actor: |
POIFS client |
Scope: |
POIFS |
Level: |
Summary |
Stakeholders and Interests: |
- POIFS client- wants to remove a file from a file
system
- POIFS - knows how to manage the file system
|
Precondition: |
Either
- The file system has been read (use case 1, read
existing file system) and a file has been
extracted from the file system (use case 7, read
existing file from file system)
or
- The file system has been created (use case 3,
create new file system) and a file has been
written to the file system (use case 6, write new
file to file system)
|
Minimal Guarantee: |
None |
Main Success Guarantee: |
- POIFS discards the specified file's storage.
- POIFS discards the file's Property Table
entry.
|
Extensions: |
- 1a. POIFS throws an exception if the file does not
exist.
|
|
Use Case 6: Write new file to file system |
Primary Actor: |
POIFS client |
Scope: |
POIFS |
Level: |
Summary |
Stakeholders and Interests: |
- POIFS client- wants to add a new file to the file
system
- POIFS - knows how to manage the file system
|
Precondition: |
The specified file does not yet exist in the file
system |
Minimal Guarantee: |
None |
Main Success Guarantee: |
- The POIFS client provides a file name
- POIFS creates a new Property Table entry for the
new file
- POIFS provides the POIFS client with an
OutputStream to write to.
- The POIFS client writes data to the provided
OutputStream .
- The POIFS client closes the provided
OutputStream
- POIFS updates the Property Table entry with the
new file's size
|
Extensions: |
- 1a. POIFS throws an exception if a file with the
specified name already exists in the file
system.
- 1b. POIFS throws an exception if the file name is
too long. The limit on file name length is 31
characters.
|
|
Use Case 7: Read existing file from file system |
Primary Actor: |
POIFS client |
Scope: |
POIFS |
Level: |
Summary |
Stakeholders and Interests: |
- POIFS client- wants to read a file from the file
system
- POIFS - knows how to manage the file system
|
Precondition: |
- The file system has been read (use case 1, read
existing file system) or has been created and
written to (use case 3, create new file system;
use case 6, write new file to file system).
- The specified file exists in the file system.
|
Minimal Guarantee: |
None |
Main Success Guarantee: |
- The POIFS client provides the name of a file to be
read
- POIFS provides an
InputStream to read
from.
- The POIFS client reads from the
InputStream .
- The POIFS client closes the
InputStream .
|
Extensions: |
1a. POIFS throws an exception if no file with the
specified name exists. |
|
Use Case 8: Read file system directory |
Primary Actor: |
POIFS client |
Scope: |
POIFS |
Level: |
Summary |
Stakeholders and Interests: |
- POIFS client- wants to know what files exist in
the file system
- POIFS - knows how to manage the file system
|
Precondition: |
The file system has been read (use case 1, read
existing file system) or created (use case 3, create
new file system) |
Minimal Guarantee: |
None |
Main Success Guarantee: |
- The POIFS client requests the file system
directory.
- POIFS returns an
Iterator . The
Iterator will not include the root
entry in the Property Table, and may be an
Iterator over an empty
Collection .
|
Extensions: |
None |
|
Use Case 9: Read file |
Primary Actor: |
POIFS |
Scope: |
POIFS |
Level: |
Summary |
Stakeholders and Interests: |
- POIFS - POIFS needs to read a file, or something
resembling a file (i.e., the Property Table, the
Small Block Array, or the Small Block Allocation
Table)
|
Precondition: |
None |
Minimal Guarantee: |
None |
Main Success Guarantee: |
- POIFS begins with a start block, a file size, and
a flag indicating whether to use the Big Block
Allocation Table or the Small Block Allocation
Table
- POIFS returns an
InputStream .
- Reads from the
InputStream are
performed by walking the specified Block
Allocation Table and reading the blocks
indicated.
- POIFS closes the
InputStream when
finished reading the file, or its client wants to
close the InputStream .
|
Extensions: |
3a. An exception will be thrown if the specified Block
Allocation Table is corrupt, as evidenced by an index
pointing to a non-existent block, or by a chain
extending past the known size of the file. |
|
Use Case 10: Rename existing file in the file system |
Primary Actor: |
POIFS client |
Scope: |
POIFS |
Level: |
Summary |
Stakeholders and Interests: |
- POIFS client- wants to rename an existing file in
the file system.
- POIFS - knows how to manage the file system.
|
Precondition: |
- The file system is has been read (use case 1, read
existing file system) or has been created and
written to (use case 3, create new file system;
use case 6, write new file to file system.
- The specified file exists in the file system.
- The new name for the file does not duplicate
another file in the file system.
|
Minimal Guarantee: |
None |
Main Success Guarantee: |
- POIFS updates the Property Table entry for the
specified file with its new name.
|
Extensions: |
- 1a. If the old file name is not in the file
system, POIFS throws an exception.
- 1b. If the new file name already exists in the
file system, POIFS throws an exception.
- 1c. If the new file name is too long (the limit is
31 characters), POIFS throws an exception.
|
|
|
|