Package com.logicaldoc.core.util
Class UserUtil
java.lang.Object
com.logicaldoc.core.util.UserUtil
Various utilities about users.
- Since:
- 6.1
- Author:
- Matteo Caruso - LogicalDOC
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidgenerateDefaultAvatar(User user) Updates the avatar of a user with the default avatar that is the Gravatar or the auto-generated image(in case Gravatar is not available)static StringgetAvatarImage(String userIdOrName) static FilegetUserHome(long id) This method retrieves the user folder.static FilegetUserResource(long id, String path) This method retrieves a user resource (file or folder).static FileThis method retrieves the users root folder.static voidsaveAvatar(User user, File avatarImageFile, String imageType) Updates the avatar of a user with a given .png image
- 
Method Details- 
getUserHomeThis method retrieves the user folder. If not exists, it creates the folder. The folder is: conf.userdir/id- Parameters:
- id- The user identifier
- Returns:
- the user's data folder
 
- 
getUserResourceThis method retrieves a user resource (file or folder). If the resource is a folder and not exists, it creates the folder. The folder will be: conf.userdir/id/path- Parameters:
- id- The user identifier
- path- The resource path
- Returns:
- the user's resource
 
- 
getUsersDirThis method retrieves the users root folder. If not exists, it creates the folder. The folder is: conf.userdir- Returns:
- the root folder that contains the users data folders
 
- 
saveAvatarUpdates the avatar of a user with a given .png image- Parameters:
- user- The user to elaborate
- avatarImageFile- The file containing the avatar image
- avatarImageFile- The image type(eg png, svg)
 
- 
generateDefaultAvatarUpdates the avatar of a user with the default avatar that is the Gravatar or the auto-generated image(in case Gravatar is not available)- Parameters:
- user- The user to elaborate
 
- 
getAvatarImage- Throws:
- PersistenceException
 
 
-