POI Use Cases
Use Case 1: Read existing file system
Primary Actor: POI client
Scope: POI
Level: Summary
Stakeholders and Interests:
POI client- wants to read content of file system
POI - understands POI file system
Precondition: None
Minimal Guarantee: None
Main Success Guarantee:
POI client requests POI to read a POI file system, providing an InputStream containing POI file system in question.
POI reads from the InputStream in 512 byte blocks
POI verifies that the first block begins with the well known signature (0xE11AB1A1E011CFD0)
POI reads the Block Allocation Table from the first block and, if necessary, from the XBAT blocks.
POI obtains the start block of the Property Table and reads the Property Table (use case 9, read file)
POI reads the individual entries in the Property Table
POI obtains the start block of the Small Block Allocation Table and reads the Small Block Allocation Table (use case 9, read file)
POI 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 POI file system, and POI throws an appropriate exception.
3a. If the signature is incorrect, the InputStream is not that of a POI file system, and POI throws an appropriate exception.
Use Case 2: Write file system
Primary Actor: POI client
Scope: POI
Level: Summary
Stakeholders and Interests:
POI client- wants to write file system out.
POI - 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 systen; 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:
POI client provides an OutputStream to write the file system to.
POI 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, POI creates a Small Block Array of sufficient size to hold all of the small files.
POI 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.
POI creates a set of big blocks sufficient to store the Block Allocation Table
POI creates and writes the header block
POI writes out the XBAT blocks, if needed.
POI writes out the Small Block Array, if needed
POI writes out the Small Block Allocation Table, if needed
POI writes out the Property Table
POI writes out the large files, if needed
POI closes the OutputStream.
Extensions:
6a. Exceptions writing to the OutputStream will be propagared back to the POI client.
7a. Exceptions writing to the OutputStream will be propagared back to the POI client.
8a. Exceptions writing to the OutputStream will be propagared back to the POI client.
9a. Exceptions writing to the OutputStream will be propagared back to the POI client.
10a. Exceptions writing to the OutputStream will be propagared back to the POI client.
11a. Exceptions writing to the OutputStream will be propagared back to the POI client.
12a. Exceptions closing the OutputStream will be propagared back to the POI client.
Use Case 3: Create new file system
Primary Actor: POI client
Scope: POI
Level: Summary
Stakeholders and Interests:
POI client- wants to create a new file system.
POI - knows how to create a new file system.
Precondition:
Minimal Guarantee: None
Main Success Guarantee:
POI creates an empty Property Table.
Extensions: None
Use Case 4: Replace file in file system
Primary Actor: POI client
Scope: POI
Level: Summary
Stakeholders and Interests:
POI client- wants to replace an existing file in the file system
POI - 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)
The file already exists in the file system.
Minimal Guarantee: None
Main Success Guarantee:
POI discards storage of the existing file.
POI updates the existing file's entry in the Property Table
POI stores the new file's data
Extensions:
1a. POI throws an exception if the file does not exist.
Use Case 5: Delete file from file system
Primary Actor: POI client
Scope: POI
Level: Summary
Stakeholders and Interests:
POI client- wants to remove a file from a file system
POI - knows how to manage the file system
Precondition:
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)
The file already exists in the file system.
Minimal Guarantee: None
Main Success Guarantee:
POI discards the specified file's storage
POI discards the file's Property Table entry
Extensions:
1a. POI throws an exception if the file does not exist.
Use Case 6: Write new file to file system
Primary Actor: POI client
Scope: POI
Level: Summary
Stakeholders and Interests:
POI client- wants to add a new file to the file system
POI - 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 POI client provides a file name
POI creates a new Property Table entry for the new file
POI provides the POI client with an OutputStream to write to.
The POI client writes data to the provided OutputStream.
The POI client closes the provided OutputStream
POI updates the Property Table entry with the new file's size
Extensions:
1a. POI throws an exception if a file with the specified name already exists in the file system.
1b. POI throws an exception if the file name is too long. The limit on file name length is 32 characters.
Use Case 7: Read existing file from file system
Primary Actor: POI client
Scope: POI
Level: Summary
Stakeholders and Interests:
POI client- wants to read a file from the file system.
POI - 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.
Minimal Guarantee: None
Main Success Guarantee:
The POI client provides the name of a file to be read
POI provides an InputStream to read from.
The POI client reads from the InputStream.
The POI client closes the InputStream.
Extensions:
1a. POI throws an exception if no file with the specified name exists.
Use Case 8: Read file system directory
Primary Actor: POI client
Scope: POI
Level: Summary
Stakeholders and Interests:
POI client- wants to know what files exist in the file system.
POI - POI 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 POI client requests the file system directory.
POI 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: POI
Scope: POI
Level: Summary
Stakeholders and Interests:
POI - POI 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:
POI 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
POI returns an InputStream.
Reads from the InputStream are performed by walking the specified Block Allocation Table and reading the blocks indicated.
POI 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 file system
Primary Actor: POI client
Scope: POI
Level: Summary
Stakeholders and Interests:
POI client- wants to rename an existing file in the file system.
POI - 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:
POI 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, POI throws an exception.
1b. If the new file name already exists in the file system, POI throws an exception.
1c. If the new file name is too long (the limit is 32 characters), POI throws an exception.