public class AvatarServeDataProducer<AU extends AppUser> extends java.lang.Object implements ServeDataProducer
DEFAULT_SERVE_DATA_TAG| Constructor and Description |
|---|
AvatarServeDataProducer(AppContext conn) |
| Modifier and Type | Method and Description |
|---|---|
AppContext |
getContext() |
MimeStreamData |
getData(SessionService user,
java.util.List<java.lang.String> path)
Get a MimeStreamData corresponding to the data to be served
This method also implements access control and returns null if access is denied.
|
java.lang.String |
getDownloadName(SessionService user,
java.util.List<java.lang.String> path)
get a download file-name to be added to a download link.
|
java.lang.String |
getTag()
get the construction tag
|
public AvatarServeDataProducer(AppContext conn)
conn - public final AppContext getContext()
getContext in interface Contexedpublic final java.lang.String getTag()
Taggedpublic MimeStreamData getData(SessionService user, java.util.List<java.lang.String> path) throws java.lang.Exception
ServeDataProducerSessionService may not have a current person set so you have to check for
null SessionService and null AppUser as well as the users permissions.getData in interface ServeDataProducerjava.lang.Exceptionpublic java.lang.String getDownloadName(SessionService user, java.util.List<java.lang.String> path) throws java.lang.Exception
ServeDataProducerMimeStreamData.getName() if ServeDataProducer.getData(SessionService, List) returns a non-null value.
However this method may be called by display content generation code so if the result is generated on the fly it might be possible to generate the download name in
a more lightweight fashion. It should also work to always return null thought he browser will use the last part of the selection path as the downloadgetDownloadName in interface ServeDataProducerjava.lang.Exception