|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--AccountFileManager
This class takes care of file manipulations on the server, as well creating new user accounts, checking the login operation, and reading the user's directory contents.
| Constructor Summary | |
AccountFileManager(org.bioquery.bqutils.BQUser user,
java.lang.String bioqueryDirectory)
Constructor needs a BQUser object and the path to the bioquery-users directory. |
|
| Method Summary | |
boolean |
authenticate()
Checks the username and password of the BQUser passed in the constructor. |
boolean |
copyFile(java.lang.String oldPath,
java.lang.String newPath)
Copies the file from oldPath to newPath. |
boolean |
createDirectory(java.lang.String path)
Creates a new directory in the user's home directory. |
boolean |
createNewAccount()
Creates a new user account based on the BQUser passed to the constructor. |
boolean |
deleteFile(java.lang.String path)
Deletes the file or directory at path. |
boolean |
moveFile(java.lang.String oldPath,
java.lang.String newPath)
Moves the file from oldPath to newPath. |
java.io.InputStream |
openFile(java.lang.String filePath)
Opens the file for the given filePath and returns an InputStream to that file's contents. |
boolean |
renameFile(java.lang.String oldPath,
java.lang.String newName)
Renames the file at oldPath to newName. |
boolean |
saveFile(java.io.InputStream content,
java.lang.String path)
Saves the contents of the given InputStream into a file with the location and name given in path. |
java.util.List |
updateFileList()
Returns a List containing the full path of every file and directory in this users account, relative to this users directory. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AccountFileManager(org.bioquery.bqutils.BQUser user,
java.lang.String bioqueryDirectory)
user - a BQUser object with the username and password.bioqueryDirectory - A String of the full path to the bioquery users directory.
Should be the the bioquery-users directory for all users, not to the subdirectory of
the BQUser passed in (which is bioqueryDirectory + username).| Method Detail |
public boolean createNewAccount()
public boolean authenticate()
public java.util.List updateFileList()
public java.io.InputStream openFile(java.lang.String filePath)
public boolean createDirectory(java.lang.String path)
path - a path to the new directory relative to the user's home directory.
public boolean saveFile(java.io.InputStream content,
java.lang.String path)
content - An InputStream from which the file contents can be read.path - The path at which to save the file, relative to the user's home directory,
and including the filename on the end.public boolean deleteFile(java.lang.String path)
path - the path of the file or directory to be deleted, relative to the user's
home directory.
public boolean moveFile(java.lang.String oldPath,
java.lang.String newPath)
oldPath - The current location of the file to be moved, relative to the
user's home directory.newPath - The location to move the file to.
public boolean copyFile(java.lang.String oldPath,
java.lang.String newPath)
oldPath - The current location of the file to be copied, relative to the
user's home directory.newPath - The location to copy the file to.
public boolean renameFile(java.lang.String oldPath,
java.lang.String newName)
oldPath - The current path to the file to be renamed, relative to the
user's home directory.newName - The name to change the filename to, without any path inforamtion.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||