net.sourceforge.pavlov.user
Interface UserFile

All Known Implementing Classes:
LocalUserFile

public interface UserFile

Describe interface UserFile here.


Method Summary
 boolean canRead()
          Returns true if the file is readable.
 boolean canWrite()
          Returns true if the file is writable.
 boolean exists()
          Returns true if the file exists.
 User read(String password)
          Reads the user from the file if it exists and if the password is correct.
 void save(User user)
          Save the user to the file.
 

Method Detail

exists

boolean exists()
Returns true if the file exists.

Returns:
a boolean value

canRead

boolean canRead()
Returns true if the file is readable.

Returns:
a boolean value

canWrite

boolean canWrite()
Returns true if the file is writable.

Returns:
a boolean value

save

void save(User user)
          throws FileNotFoundException,
                 IOException
Save the user to the file.

Parameters:
user - an User value
Throws:
FileNotFoundException - if an error occurs
IOException - if an error occurs

read

User read(String password)
          throws SAXException,
                 FileNotFoundException,
                 IOException
Reads the user from the file if it exists and if the password is correct.

Parameters:
password - a String value
Returns:
an User value
Throws:
SAXException - if an error occurs
FileNotFoundException - if an error occurs
IOException - if an error occurs