|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.loom.resolution.AbstractHttpResolution
org.loom.resolution.AbstractFileResolution
public abstract class AbstractFileResolution
Delivers a binary file to the browser
| Constructor Summary | |
|---|---|
AbstractFileResolution()
|
|
| Method Summary | |
|---|---|
AbstractFileResolution |
addCookie(javax.servlet.http.Cookie cookie)
Adds a cookie |
AbstractFileResolution |
addCookie(java.lang.String name,
java.lang.String value)
Adds a cookie that will not be stored on disk (will be deleted when the browser is closed). |
AbstractFileResolution |
addCookie(java.lang.String name,
java.lang.String value,
int maxAge)
Adds a cookie |
AbstractFileResolution |
addHeader(java.lang.String name,
java.lang.Object value)
Add a http header. |
java.lang.String |
calculateContentDispositionHeader(java.lang.String filename)
|
java.lang.String |
getFilename()
|
java.lang.Long |
getFileSize()
|
boolean |
isForceSave()
|
boolean |
isGuessMimeType()
|
abstract void |
resolve(LoomServletRequest request,
LoomServletResponse response)
Write the response contents |
AbstractFileResolution |
setCacheControl(CacheControl cacheControl)
Sets the cache data to be sent to the browser |
AbstractFileResolution |
setCharset(java.lang.String charset)
Sets the character encoding (MIME charset) of the response being sent to the client, for example, to UTF-8. |
AbstractFileResolution |
setContentType(java.lang.String contentType)
Sets the content type of the response being sent to the client, if the response has not been committed yet. |
AbstractFileResolution |
setFilename(java.lang.String filename)
|
AbstractFileResolution |
setFileSize(java.lang.Long fileSize)
|
AbstractFileResolution |
setForceSave(boolean forceSave)
|
AbstractFileResolution |
setGuessMimeType(boolean guessMimeType)
|
AbstractFileResolution |
setHeader(java.lang.String name,
java.lang.Object value)
Set a String http header. |
AbstractFileResolution |
setHeaderIfNotPresent(java.lang.String name,
java.lang.Object value)
Set a String http header if it has not been set. |
protected void |
writeHeaders(LoomServletRequest request,
LoomServletResponse response)
Calculate default content size, content type, etc headers that will be applied if the user did not provide one previously. |
| Methods inherited from class org.loom.resolution.AbstractHttpResolution |
|---|
addDateHeader, addIntHeader, containsHeader, getCacheControl, getCharset, getContentType, setDateHeader, setDateHeaderIfNotPresent, setIntHeader, setIntHeaderIfNotPresent, setJsonHeader |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractFileResolution()
| Method Detail |
|---|
public abstract void resolve(LoomServletRequest request,
LoomServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException
Resolution
resolve in interface Resolutionresolve in class AbstractHttpResolutionrequest - the current request objectresponse - the current response object
java.io.IOException
javax.servlet.ServletException
protected void writeHeaders(LoomServletRequest request,
LoomServletResponse response)
writeHeaders in class AbstractHttpResolutionpublic java.lang.String calculateContentDispositionHeader(java.lang.String filename)
public AbstractFileResolution setForceSave(boolean forceSave)
public boolean isGuessMimeType()
public AbstractFileResolution setGuessMimeType(boolean guessMimeType)
public boolean isForceSave()
public java.lang.String getFilename()
public AbstractFileResolution setFilename(java.lang.String filename)
public java.lang.Long getFileSize()
public AbstractFileResolution setFileSize(java.lang.Long fileSize)
public AbstractFileResolution addCookie(java.lang.String name,
java.lang.String value)
HttpResolution
addCookie in interface HttpResolutionaddCookie in class AbstractHttpResolutionname - the name of the cookievalue - the value of the Cookie
public AbstractFileResolution addCookie(java.lang.String name,
java.lang.String value,
int maxAge)
HttpResolution
addCookie in interface HttpResolutionaddCookie in class AbstractHttpResolutionname - the name of the cookievalue - the value of the CookiemaxAge - can be positive (number of seconds that it will be stored in
the browser), zero (to delete the cookie from the browser) or
a negative value (to indicate that the cookie should not be
stored in disk and will be forgotten when the browser exists).public AbstractFileResolution addCookie(javax.servlet.http.Cookie cookie)
HttpResolution
addCookie in interface HttpResolutionaddCookie in class AbstractHttpResolutioncookie - the cookie to be added to the response
public AbstractFileResolution addHeader(java.lang.String name,
java.lang.Object value)
HttpResolution
addHeader in interface HttpResolutionaddHeader in class AbstractHttpResolutionname - the name of the http headervalue - the value of the http header. Date, int and String are supported. Anything else will be cast to toString(). Null will be ignored.
public AbstractFileResolution setHeader(java.lang.String name,
java.lang.Object value)
HttpResolution
setHeader in interface HttpResolutionsetHeader in class AbstractHttpResolutionname - the name of the http headervalue - the value of the http header
public AbstractFileResolution setHeaderIfNotPresent(java.lang.String name,
java.lang.Object value)
HttpResolution
setHeaderIfNotPresent in interface HttpResolutionsetHeaderIfNotPresent in class AbstractHttpResolutionname - the name of the http headervalue - the value of the http headerpublic AbstractFileResolution setCharset(java.lang.String charset)
HttpResolution
setCharset in interface HttpResolutionsetCharset in class AbstractHttpResolutionpublic AbstractFileResolution setContentType(java.lang.String contentType)
HttpResolutiontext/html;charset=UTF-8.
Notice that #setCharset(String) can also be used for this.
setContentType in interface HttpResolutionsetContentType in class AbstractHttpResolutionpublic AbstractFileResolution setCacheControl(CacheControl cacheControl)
CacheableResolution
setCacheControl in interface CacheableResolutionsetCacheControl in interface HttpResolutionsetCacheControl in class AbstractHttpResolutioncacheControl - the cache data.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||