public class DefaultAvatarController extends java.lang.Object implements BoxAvatarView.AvatarController, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DEFAULT_MAX_AGE |
protected BoxApiUser |
mApiUser |
protected java.util.HashSet<java.lang.String> |
mCleanedDirectories |
protected java.util.concurrent.ThreadPoolExecutor |
mExecutor |
protected BoxSession |
mSession |
protected java.util.HashSet<java.lang.String> |
mUnavailableAvatars |
| Constructor and Description |
|---|
DefaultAvatarController(BoxSession session) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanOutOldAvatars(java.io.File directory,
int maxLifeInDays)
Delete all files for user that is older than maxLifeInDays
|
BoxFutureTask<BoxDownload> |
executeAvatarDownloadRequest(java.lang.String userId,
BoxAvatarView avatarView) |
protected void |
executeTask(BoxFutureTask task) |
protected BoxApiUser |
getApiUser() |
protected java.io.File |
getAvatarDir(java.lang.String userId) |
java.io.File |
getAvatarFile(java.lang.String userId) |
protected BoxSession |
getSession() |
protected BoxSession mSession
protected transient BoxApiUser mApiUser
protected java.util.HashSet<java.lang.String> mUnavailableAvatars
protected java.util.HashSet<java.lang.String> mCleanedDirectories
protected transient java.util.concurrent.ThreadPoolExecutor mExecutor
protected static final int DEFAULT_MAX_AGE
public DefaultAvatarController(BoxSession session)
protected java.io.File getAvatarDir(java.lang.String userId)
public java.io.File getAvatarFile(java.lang.String userId)
getAvatarFile in interface BoxAvatarView.AvatarControlleruserId - User id that avatar File should correspond to.protected BoxApiUser getApiUser()
protected BoxSession getSession()
protected void cleanOutOldAvatars(java.io.File directory,
int maxLifeInDays)
directory - the directory where avatar files are being held.maxLifeInDays - the number of days avatar files are allowed to live for.public BoxFutureTask<BoxDownload> executeAvatarDownloadRequest(java.lang.String userId, BoxAvatarView avatarView)
executeAvatarDownloadRequest in interface BoxAvatarView.AvatarControlleruserId - User id that avatar File should correspond to.avatarView - the avatar view to update after download.protected void executeTask(BoxFutureTask task)