Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4F0859300 for ; Mon, 27 Feb 2012 04:02:09 +0000 (UTC) Received: (qmail 34283 invoked by uid 500); 27 Feb 2012 04:02:05 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 34172 invoked by uid 500); 27 Feb 2012 04:02:04 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 34120 invoked by uid 99); 27 Feb 2012 04:02:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Feb 2012 04:02:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Feb 2012 04:02:01 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 45B0F238899C; Mon, 27 Feb 2012 04:01:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1294018 - /cxf/branches/2.5.x-fixes/rt/transports/common/src/main/java/org/apache/cxf/transport/common/gzip/GZIPOutInterceptor.java Date: Mon, 27 Feb 2012 04:01:41 -0000 To: commits@cxf.apache.org From: ffang@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120227040141.45B0F238899C@eris.apache.org> Author: ffang Date: Mon Feb 27 04:01:40 2012 New Revision: 1294018 URL: http://svn.apache.org/viewvc?rev=1294018&view=rev Log: [CXF-4134]also add and reuse a ENCODINGS pattern Modified: cxf/branches/2.5.x-fixes/rt/transports/common/src/main/java/org/apache/cxf/transport/common/gzip/GZIPOutInterceptor.java Modified: cxf/branches/2.5.x-fixes/rt/transports/common/src/main/java/org/apache/cxf/transport/common/gzip/GZIPOutInterceptor.java URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/transports/common/src/main/java/org/apache/cxf/transport/common/gzip/GZIPOutInterceptor.java?rev=1294018&r1=1294017&r2=1294018&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/rt/transports/common/src/main/java/org/apache/cxf/transport/common/gzip/GZIPOutInterceptor.java (original) +++ cxf/branches/2.5.x-fixes/rt/transports/common/src/main/java/org/apache/cxf/transport/common/gzip/GZIPOutInterceptor.java Mon Feb 27 04:01:40 2012 @@ -76,6 +76,11 @@ public class GZIPOutInterceptor extends public static final Pattern ZERO_Q = Pattern.compile(";\\s*q=0(?:\\.0+)?$"); /** + * regular expression which can split encodings + */ + public static final Pattern ENCODINGS = Pattern.compile("[,\\s]*,\\s*"); + + /** * Key under which we store the original output stream on the message, for * use by the ending interceptor. */ @@ -195,7 +200,7 @@ public class GZIPOutInterceptor extends List nonZeros = new ArrayList(3); for (String headerLine : acceptEncodingHeader) { - String[] encodings = headerLine.trim().split("[,\\s]*,\\s*"); + String[] encodings = ENCODINGS.split(headerLine.trim()); for (String enc : encodings) { Matcher m = ZERO_Q.matcher(enc);