public class WorkSpaceManager
extends java.lang.Object
| Constructor and Description |
|---|
WorkSpaceManager(java.io.File rootPath)
Creates a new workspace manager.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
deleteUserWS(java.lang.String username)
Deletes the workspace of the specified user.
|
boolean |
emptyUserWS(java.lang.String username)
This method empties the workspace of the specified user.
|
java.io.File |
getRootPath()
Returns the workspaces root path.
|
UserParameter |
getUserParameter(java.lang.String userName,
int projectId,
java.lang.String parameterKey)
Returns the UserParameter associated with the userName / projectId / parameterKey.
|
java.io.File |
getUserWSDirectory(java.lang.String username)
This method returns the workspace path of the specified user.
|
java.util.List<UserParameter> |
loadUserParameter(java.lang.String userName,
int projectId)
Loads user parameters from user workspace / projectID.
|
boolean |
saveUserParameter(java.util.List<UserParameter> userParameters,
java.lang.String userName,
int projectId)
Saves user parameters to user_workspace / projectID / USER_PARAMETER_FILE.
|
void |
setUserParameter(java.lang.String userName,
int projectId,
UserParameter userParameter)
Saves a UserParameter
|
public WorkSpaceManager(java.io.File rootPath)
throws java.io.IOException
rootPath - the workspaces root path.java.io.IOException - if the path cannot be createdpublic java.io.File getRootPath()
public java.io.File getUserWSDirectory(java.lang.String username)
username - , the user namepublic boolean emptyUserWS(java.lang.String username)
username - , the user namepublic boolean deleteUserWS(java.lang.String username)
username - , the user namepublic UserParameter getUserParameter(java.lang.String userName, int projectId, java.lang.String parameterKey)
null if not found.userName - the user nameprojectId - the project id or JMapServerRequest.SaveUserParameters.GLOBAL_PARAMETERSparameterKey - the parameter key to searchpublic void setUserParameter(java.lang.String userName,
int projectId,
UserParameter userParameter)
userName - the user nameprojectId - the project id or JMapServerRequest.SaveUserParameters.GLOBAL_PARAMETERSuserParameter - user parameter to savepublic boolean saveUserParameter(java.util.List<UserParameter> userParameters, java.lang.String userName, int projectId)
userParameters - list of UserParameter to be saved.userName - user name used to get the directory where the user
parameter file will be saved.projectId - project ID used to get the directory where the user
parameter file will be saved.public java.util.List<UserParameter> loadUserParameter(java.lang.String userName, int projectId)
userName - user name used to get the directory where the user
parameter file will be saved.projectId - project ID used to get the directory where the user
parameter file will be saved.