aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Becker2012-04-02 07:41:36 (EDT)
committerThomas Becker2012-04-02 07:41:36 (EDT)
commit2b83d9d9545a148eacca3fc5461eec27a502b1e2 (patch)
treeefbb15a8680a94069907c342d749cfe1a28f6941
parentcc1bef6f2e43f120e417e9771976e992ba73d7f0 (diff)
downloadorg.eclipse.jetty.project-2b83d9d9545a148eacca3fc5461eec27a502b1e2.zip
org.eclipse.jetty.project-2b83d9d9545a148eacca3fc5461eec27a502b1e2.tar.gz
org.eclipse.jetty.project-2b83d9d9545a148eacca3fc5461eec27a502b1e2.tar.bz2
375692: cosmetic changes to get rid of warnings, etc.refs/changes/16/5516/1
-rw-r--r--jetty-http/src/main/java/org/eclipse/jetty/http/gzip/AbstractCompressedStream.java4
-rw-r--r--jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java31
2 files changed, 16 insertions, 19 deletions
diff --git a/jetty-http/src/main/java/org/eclipse/jetty/http/gzip/AbstractCompressedStream.java b/jetty-http/src/main/java/org/eclipse/jetty/http/gzip/AbstractCompressedStream.java
index f879610..77ac1fe 100644
--- a/jetty-http/src/main/java/org/eclipse/jetty/http/gzip/AbstractCompressedStream.java
+++ b/jetty-http/src/main/java/org/eclipse/jetty/http/gzip/AbstractCompressedStream.java
@@ -13,8 +13,6 @@
package org.eclipse.jetty.http.gzip;
-import java.io.Closeable;
-import java.io.Flushable;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
@@ -32,7 +30,7 @@ import org.eclipse.jetty.util.ByteArrayOutputStream2;
/**
* Skeletal implementation of a CompressedStream. This class adds compression features to a ServletOutputStream and takes care of setting response headers, etc.
* Major work and configuration is done here. Subclasses using different kinds of compression only have to implement the abstract methods doCompress() and
- * setContentEncoding() using the desired compression and setting the appropiate Content-Encoding header string.
+ * setContentEncoding() using the desired compression and setting the appropriate Content-Encoding header string.
*/
public abstract class AbstractCompressedStream extends ServletOutputStream
{
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java
index 40564ca..2f4128d 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/GzipFilter.java
@@ -151,21 +151,6 @@ public class GzipFilter extends UserAgentFilter
}
/* ------------------------------------------------------------ */
- public String selectCompression(String encodingHeader)
- {
- // TODO, this could be a little more robust.
- // prefer gzip over deflate
- if (encodingHeader!=null)
- {
- if (encodingHeader.toLowerCase().contains(GZIP))
- return GZIP;
- if (encodingHeader.toLowerCase().contains(DEFLATE))
- return DEFLATE;
- }
- return null;
- }
-
- /* ------------------------------------------------------------ */
/**
* @see org.eclipse.jetty.servlets.UserAgentFilter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
*/
@@ -176,7 +161,6 @@ public class GzipFilter extends UserAgentFilter
HttpServletRequest request=(HttpServletRequest)req;
HttpServletResponse response=(HttpServletResponse)res;
- String ae = request.getHeader("accept-encoding");
String compressionType = selectCompression(request.getHeader("accept-encoding"));
if (compressionType!=null && !response.containsHeader("Content-Encoding") && !HttpMethods.HEAD.equalsIgnoreCase(request.getMethod()))
{
@@ -223,6 +207,21 @@ public class GzipFilter extends UserAgentFilter
}
}
+ /* ------------------------------------------------------------ */
+ private String selectCompression(String encodingHeader)
+ {
+ // TODO, this could be a little more robust.
+ // prefer gzip over deflate
+ if (encodingHeader!=null)
+ {
+ if (encodingHeader.toLowerCase().contains(GZIP))
+ return GZIP;
+ else if (encodingHeader.toLowerCase().contains(DEFLATE))
+ return DEFLATE;
+ }
+ return null;
+ }
+
protected CompressedResponseWrapper createWrappedResponse(HttpServletRequest request, HttpServletResponse response, final String compressionType)
{
CompressedResponseWrapper wrappedResponse = null;