|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.pavlov.user.LocalUserFile
public final class LocalUserFile
A user file that resides on the same computer the application is running on.
Constructor Summary | |
---|---|
LocalUserFile(String userName)
Creates a new LocalUserFile instance named
for this user in the subdirectory "users/". |
|
LocalUserFile(String userName,
String userDir)
Creates a new LocalUserFile named for the
user in the given directory. |
Method Summary | |
---|---|
boolean |
canRead()
Returns true if the file exists and is readable. |
boolean |
canWrite()
If the file exists, return if it is writable. |
boolean |
exists()
Returns true if the file exists and is readable. |
protected String |
getFileName(String userName)
Converts the userDir and the userName into a file path. |
User |
read(String password)
Attempts to read the given user file. |
void |
save(User user)
Saves the given user information to this file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocalUserFile(String userName, String userDir) throws IOException
LocalUserFile
named for the
user in the given directory.
userName
- a String
valuenewUserDir
- a String
value
IOException
- if an error occurspublic LocalUserFile(String userName) throws IOException
LocalUserFile
instance named
for this user in the subdirectory "users/".
userName
- a String
value
IOException
- if an error occursMethod Detail |
---|
public boolean exists()
exists
in interface UserFile
boolean
valuepublic void save(User user) throws FileNotFoundException, IOException
save
in interface UserFile
user
- an User
value
FileNotFoundException
- if an error occurs
IOException
- if an error occurspublic User read(String password) throws SAXException, FileNotFoundException, IOException
read
in interface UserFile
password
- a String
value
User
value
SAXException
- if an error occurs
FileNotFoundException
- if an error occurs
IOException
- if an error occurspublic boolean canRead()
canRead
in interface UserFile
boolean
valuepublic boolean canWrite()
canWrite
in interface UserFile
boolean
valueprotected String getFileName(String userName)
userName
- a String
value
String
value
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |