|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectaddressbook.FileSystem
public class FileSystem
An object of this class manages interaction between the address book program and the file system of the computer it is running on.
| Constructor Summary | |
|---|---|
FileSystem()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getDefaultDirectory()
Get the default directory for open/save/print |
AddressBook |
readFile(java.io.File file)
Read a stored file |
void |
saveFile(AddressBook addressBook,
java.io.File file)
Save an address book to a file |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileSystem()
| Method Detail |
|---|
public AddressBook readFile(java.io.File file)
throws java.io.IOException,
java.lang.ClassNotFoundException
file - the file specification for the file to read
java.io.IOException - if there is a problem reading the file
java.lang.ClassCastException - if the file does not contain an
AddressBook
java.lang.ClassNotFoundException - if the file does not contain
an AddressBook, and the class it does contain is not
found - this should never happen
public void saveFile(AddressBook addressBook,
java.io.File file)
throws java.io.IOException
addressBook - the AddressBook to savefile - the file specification for the file to create
java.io.IOException - if there is a problem writing the filepublic java.lang.String getDefaultDirectory()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||