public class ResponseWriter extends Object implements Serializable
| Constructor and Description |
|---|
ResponseWriter()
Deprecated.
Use
ResponseWriter(DeploymentConfiguration) instead. |
ResponseWriter(DeploymentConfiguration deploymentConfiguration)
Create a response writer with the given deployment configuration.
|
ResponseWriter(int bufferSize)
Deprecated.
This constructor is never used internally and might be
removed.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
acceptsBrotliResource(javax.servlet.http.HttpServletRequest request)
Returns whether it is ok to serve a Brotli version of the given resource.
|
protected boolean |
acceptsGzippedResource(javax.servlet.http.HttpServletRequest request)
Returns whether it is ok to serve a gzipped version of the given
resource.
|
void |
writeResponseContents(String filenameWithPath,
URL resourceUrl,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Writes the contents and content type (if available) of the given
resourceUrl to the response.
|
@Deprecated public ResponseWriter()
ResponseWriter(DeploymentConfiguration) instead.DEFAULT_BUFFER_SIZE.@Deprecated public ResponseWriter(int bufferSize)
bufferSize - custom buffer sizepublic ResponseWriter(DeploymentConfiguration deploymentConfiguration)
deploymentConfiguration - the deployment configuration to use, not nullpublic void writeResponseContents(String filenameWithPath, URL resourceUrl, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException
filenameWithPath - the name of the file being sentresourceUrl - the URL to the file, reported by the servlet containerrequest - the request object to read fromresponse - the response object to write toIOException - if the servlet container threw an exception while locating
the resourceprotected boolean acceptsGzippedResource(javax.servlet.http.HttpServletRequest request)
If this method returns true, the browser is ok with receiving a gzipped version of the resource. In other cases, an uncompressed file must be sent.
request - the request for the resourceprotected boolean acceptsBrotliResource(javax.servlet.http.HttpServletRequest request)
If this method returns true, the browser is ok with receiving a Brotli version of the resource. In other cases, an uncompressed or gzipped file must be sent.
request - the request for the resourceCopyright © 2000–2019 Vaadin Ltd. All rights reserved.