public interface ServeDataProducer extends Contexed, Tagged
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_SERVE_DATA_TAG |
Modifier and Type | Method and Description |
---|---|
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.
|
getContext
static final java.lang.String DEFAULT_SERVE_DATA_TAG
MimeStreamData getData(SessionService user, java.util.List<java.lang.String> path) throws java.lang.Exception
SessionService
may not have a current person set so you have to check for
null SessionService
and null AppUser
as well as the users permissions.user
- path
- java.lang.Exception
java.lang.String getDownloadName(SessionService user, java.util.List<java.lang.String> path) throws java.lang.Exception
MimeStreamData.getName()
if 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 downloaduser
- path
- java.lang.Exception