abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r772343 - in /abdera/java/trunk: client/src/main/java/org/apache/abdera/protocol/client/ core/src/main/java/org/apache/abdera/parser/ core/src/main/java/org/apache/abdera/protocol/util/ core/src/main/java/org/apache/abdera/util/ core/src/ma...
Date Wed, 06 May 2009 16:10:13 GMT
Author: jmsnell
Date: Wed May  6 16:10:11 2009
New Revision: 772343

URL: http://svn.apache.org/viewvc?rev=772343&view=rev
Log:
Some refactoring. the EncodingUtil class isn't strictly required, was mostly deprecated...
moved the still relevant code to other areas and removed the EncodingUtil class.

Added:
    abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/text/Rfc2047Helper.java
    abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/text/io/CompressionUtil.java
  (contents, props changed)
      - copied, changed from r771402, abdera/java/trunk/core/src/main/java/org/apache/abdera/util/CompressionUtil.java
Removed:
    abdera/java/trunk/core/src/main/java/org/apache/abdera/protocol/util/EncodingUtil.java
    abdera/java/trunk/core/src/main/java/org/apache/abdera/util/CompressionUtil.java
Modified:
    abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsResponse.java
    abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java
    abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/ParserOptions.java
    abdera/java/trunk/core/src/main/java/org/apache/abdera/protocol/util/AbstractMessage.java
    abdera/java/trunk/core/src/main/java/org/apache/abdera/protocol/util/CacheControlUtil.java
    abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParserOptions.java
    abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriter.java
    abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriterOptions.java
    abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/WriterOptions.java
    abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
    abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/InvalidLangTagSyntax.java
    abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java
    abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java
    abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/context/AbstractResponseContext.java
    abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/filters/CompressionFilter.java

Modified: abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsResponse.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsResponse.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsResponse.java
(original)
+++ abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/CommonsResponse.java
Wed May  6 16:10:11 2009
@@ -26,8 +26,8 @@
 import java.util.Map;
 
 import org.apache.abdera.Abdera;
+import org.apache.abdera.i18n.text.io.CompressionUtil;
 import org.apache.abdera.protocol.client.util.AutoReleasingInputStream;
-import org.apache.abdera.protocol.util.EncodingUtil;
 import org.apache.commons.httpclient.Header;
 import org.apache.commons.httpclient.HttpMethod;
 import org.apache.commons.httpclient.URIException;
@@ -153,7 +153,7 @@
       String ce = getHeader("Content-Encoding");
       in = method.getResponseBodyAsStream();
       if (ce != null)
-        in = EncodingUtil.getDecodingInputStream(in, ce);
+        in = CompressionUtil.getDecodingInputStream(in, ce);
       in = new AutoReleasingInputStream(method,in);
     }
     return in;

Modified: abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java
(original)
+++ abdera/java/trunk/client/src/main/java/org/apache/abdera/protocol/client/RequestOptions.java
Wed May  6 16:10:11 2009
@@ -29,12 +29,12 @@
 
 import org.apache.abdera.i18n.rfc4646.Lang;
 import org.apache.abdera.i18n.text.Localizer;
+import org.apache.abdera.i18n.text.Rfc2047Helper;
 import org.apache.abdera.i18n.text.UrlEncoding;
 import org.apache.abdera.i18n.text.CharUtils.Profile;
 import org.apache.abdera.protocol.Request;
 import org.apache.abdera.protocol.util.AbstractRequest;
 import org.apache.abdera.protocol.util.CacheControlUtil;
-import org.apache.abdera.protocol.util.EncodingUtil;
 import org.apache.abdera.util.EntityTag;
 import org.apache.commons.httpclient.util.DateParseException;
 import org.apache.commons.httpclient.util.DateUtil;
@@ -179,7 +179,7 @@
    * Set the value of a header using proper encoding of non-ascii characters
    */
   public RequestOptions setEncodedHeader(String header, String charset, String value) {
-    return setHeader(header, EncodingUtil.encode(value,charset));
+    return setHeader(header, Rfc2047Helper.encode(value,charset));
   }
   
   /**
@@ -188,7 +188,7 @@
   public RequestOptions setEncodedHeader(String header, String charset, String... values)
{
     if (values != null && values.length > 0) {
       for (int n = 0; n < values.length; n++) {
-        values[n] = EncodingUtil.encode(values[n], charset);
+        values[n] = Rfc2047Helper.encode(values[n], charset);
       }
       getHeaders().put(header, new String[] {combine(values)});
     } else {
@@ -232,7 +232,7 @@
    * specified header
    */
   public RequestOptions addEncodedHeader(String header, String charset, String value) {
-    return addHeader(header, EncodingUtil.encode(value, charset));
+    return addHeader(header, Rfc2047Helper.encode(value, charset));
   }
   
   /**
@@ -242,7 +242,7 @@
   public RequestOptions addEncodedHeader(String header, String charset, String... values)
{
     if (values == null || values.length == 0) return this;
     for (int n = 0; n < values.length; n++) {
-      values[n] = EncodingUtil.encode(values[n], charset);
+      values[n] = Rfc2047Helper.encode(values[n], charset);
     }
     List<String> list = Arrays.asList(getHeaders().get(header));
     String value = combine(values);

Modified: abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/ParserOptions.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/ParserOptions.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/ParserOptions.java (original)
+++ abdera/java/trunk/core/src/main/java/org/apache/abdera/parser/ParserOptions.java Wed May
 6 16:10:11 2009
@@ -23,7 +23,7 @@
 
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.filter.ParseFilter;
-import org.apache.abdera.util.CompressionUtil.CompressionCodec;
+import org.apache.abdera.i18n.text.io.CompressionUtil.CompressionCodec;
 
 /**
  * Parser options are used to modify the behavior of the parser. 

Modified: abdera/java/trunk/core/src/main/java/org/apache/abdera/protocol/util/AbstractMessage.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/core/src/main/java/org/apache/abdera/protocol/util/AbstractMessage.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/core/src/main/java/org/apache/abdera/protocol/util/AbstractMessage.java
(original)
+++ abdera/java/trunk/core/src/main/java/org/apache/abdera/protocol/util/AbstractMessage.java
Wed May  6 16:10:11 2009
@@ -20,6 +20,7 @@
 import javax.activation.MimeType;
 
 import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.i18n.text.Rfc2047Helper;
 import org.apache.abdera.i18n.text.UrlEncoding;
 import org.apache.abdera.protocol.Message;
 
@@ -58,13 +59,13 @@
   }
   
   public String getDecodedHeader(String header) {
-    return UrlEncoding.decode(EncodingUtil.decode(getHeader(header)));
+    return UrlEncoding.decode(Rfc2047Helper.decode(getHeader(header)));
   }
   
   public String[] getDecodedHeaders(String header) {
     Object[] headers = getHeaders(header);
     for (int n = 0; n < headers.length; n++) {
-      headers[n] = UrlEncoding.decode(EncodingUtil.decode(headers[n].toString()));
+      headers[n] = UrlEncoding.decode(Rfc2047Helper.decode(headers[n].toString()));
     }
     return (String[])headers;
   }

Modified: abdera/java/trunk/core/src/main/java/org/apache/abdera/protocol/util/CacheControlUtil.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/core/src/main/java/org/apache/abdera/protocol/util/CacheControlUtil.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/core/src/main/java/org/apache/abdera/protocol/util/CacheControlUtil.java
(original)
+++ abdera/java/trunk/core/src/main/java/org/apache/abdera/protocol/util/CacheControlUtil.java
Wed May  6 16:10:11 2009
@@ -23,6 +23,8 @@
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.apache.abdera.i18n.text.io.CompressionUtil;
+
 /**
  * Provides parsing and properly handling of the HTTP Cache-Control header.
  */
@@ -189,25 +191,10 @@
     public String[] getValues(Directive directive) {
       String value = getValue(directive);
       if (value != null) {
-        return splitAndTrim(value, ",", true);
+        return CompressionUtil.splitAndTrim(value, ",", true);
       }
       return null;
     }
     
-    private static String unquote(String s) {
-      if (s == null || s.length() == 0) return s;
-      if (s.startsWith("\"")) s = s.substring(1);
-      if (s.endsWith("\"")) s = s.substring(0, s.length() - 1);
-      return s;
-    }
-      
-    public static String[] splitAndTrim(String value, String delim, boolean unquote) {
-      String[] headers = (unquote) ? unquote(value).split(delim) : value.split(delim);
-      for (int n = 0; n < headers.length; n++) {
-        headers[n] = headers[n].trim();
-      }
-      return headers;
-    }
-
   }
 }

Modified: abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParserOptions.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParserOptions.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParserOptions.java
(original)
+++ abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractParserOptions.java
Wed May  6 16:10:11 2009
@@ -24,8 +24,8 @@
 
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.filter.ParseFilter;
+import org.apache.abdera.i18n.text.io.CompressionUtil.CompressionCodec;
 import org.apache.abdera.parser.ParserOptions;
-import org.apache.abdera.util.CompressionUtil.CompressionCodec;
 
 /**
  * Non thread-safe abstract implementation of ParserOptions

Modified: abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriter.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriter.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriter.java (original)
+++ abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriter.java Wed May
 6 16:10:11 2009
@@ -23,6 +23,7 @@
 import java.nio.channels.WritableByteChannel;
 import java.util.zip.DeflaterOutputStream;
 
+import org.apache.abdera.i18n.text.io.CompressionUtil;
 import org.apache.abdera.model.Base;
 import org.apache.abdera.model.Document;
 import org.apache.abdera.model.Element;

Modified: abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriterOptions.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriterOptions.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriterOptions.java
(original)
+++ abdera/java/trunk/core/src/main/java/org/apache/abdera/util/AbstractWriterOptions.java
Wed May  6 16:10:11 2009
@@ -17,7 +17,7 @@
 */
 package org.apache.abdera.util;
 
-import org.apache.abdera.util.CompressionUtil.CompressionCodec;
+import org.apache.abdera.i18n.text.io.CompressionUtil.CompressionCodec;
 import org.apache.abdera.writer.WriterOptions;
 
 public abstract class AbstractWriterOptions 

Modified: abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/WriterOptions.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/WriterOptions.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/WriterOptions.java (original)
+++ abdera/java/trunk/core/src/main/java/org/apache/abdera/writer/WriterOptions.java Wed May
 6 16:10:11 2009
@@ -17,7 +17,7 @@
 */
 package org.apache.abdera.writer;
 
-import org.apache.abdera.util.CompressionUtil.CompressionCodec;
+import org.apache.abdera.i18n.text.io.CompressionUtil.CompressionCodec;
 
 public interface WriterOptions extends Cloneable {
 

Modified: abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java (original)
+++ abdera/java/trunk/core/src/test/java/org/apache/abdera/test/core/CoreTest.java Wed May
 6 16:10:11 2009
@@ -28,11 +28,11 @@
 import junit.framework.Assert;
 
 import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.i18n.text.io.CompressionUtil;
 import org.apache.abdera.model.AtomDate;
 import org.apache.abdera.model.Entry;
 import org.apache.abdera.model.Feed;
 import org.apache.abdera.util.AbderaConfiguration;
-import org.apache.abdera.util.CompressionUtil;
 import org.apache.abdera.util.Configuration;
 import org.apache.abdera.util.Constants;
 import org.apache.abdera.util.MimeTypeHelper;

Modified: abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/InvalidLangTagSyntax.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/InvalidLangTagSyntax.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/InvalidLangTagSyntax.java
(original)
+++ abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/lang/InvalidLangTagSyntax.java
Wed May  6 16:10:11 2009
@@ -17,6 +17,9 @@
 */
 package org.apache.abdera.i18n.lang;
 
+/**
+ * @deprecated
+ **/
 public class InvalidLangTagSyntax extends RuntimeException {
 
   private static final long serialVersionUID = -2653819135178550519L;

Added: abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/text/Rfc2047Helper.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/text/Rfc2047Helper.java?rev=772343&view=auto
==============================================================================
--- abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/text/Rfc2047Helper.java
(added)
+++ abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/text/Rfc2047Helper.java
Wed May  6 16:10:11 2009
@@ -0,0 +1,90 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  The ASF licenses this file to You
+* under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.  For additional information regarding
+* copyright in this work, please see the NOTICE file in the top level
+* directory of this distribution.
+*/
+package org.apache.abdera.i18n.text;
+
+import org.apache.commons.codec.DecoderException;
+import org.apache.commons.codec.net.BCodec;
+import org.apache.commons.codec.net.QCodec;
+
+public class Rfc2047Helper {
+
+  public static final String DEFAULT_CHARSET = "UTF-8";
+  public static enum Codec { B, Q };
+  
+  public static String encode(
+    String value) {
+      return encode(
+        value, 
+        DEFAULT_CHARSET, 
+        Codec.B);
+  }
+  
+  public static String encode(
+    String value, 
+    String charset) {
+      return encode(
+        value, 
+        charset, 
+        Codec.B);
+  }
+  
+  /**
+   * Used to encode a string as specified by RFC 2047
+   * @param value The string to encode
+   * @param charset The character set to use for the encoding
+   */
+  public static String encode(
+    String value, 
+    String charset, 
+    Codec codec) {
+      if (value == null) 
+        return null;
+      try {
+        switch(codec) {
+          case Q:  return (new QCodec(charset)).encode(value);
+          case B:
+          default: return (new BCodec(charset)).encode(value);
+        }
+      } catch (Exception e) {
+        return value;
+      }
+  }
+  
+  /**
+   * Used to decode a string as specified by RFC 2047
+   * @param value The encoded string
+   */
+  public static String decode(
+    String value) {
+      if (value == null) return null;
+      try {
+        // try BCodec first
+        return (new BCodec()).decode(value);
+      } catch (DecoderException de) {
+        // try QCodec next
+        try {
+          return (new QCodec()).decode(value);
+        } catch (Exception ex) {
+          return value;
+        }
+      } catch (Exception e) {
+        return value;
+      }
+  }
+  
+}

Copied: abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/text/io/CompressionUtil.java
(from r771402, abdera/java/trunk/core/src/main/java/org/apache/abdera/util/CompressionUtil.java)
URL: http://svn.apache.org/viewvc/abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/text/io/CompressionUtil.java?p2=abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/text/io/CompressionUtil.java&p1=abdera/java/trunk/core/src/main/java/org/apache/abdera/util/CompressionUtil.java&r1=771402&r2=772343&rev=772343&view=diff
==============================================================================
--- abdera/java/trunk/core/src/main/java/org/apache/abdera/util/CompressionUtil.java (original)
+++ abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/text/io/CompressionUtil.java
Wed May  6 16:10:11 2009
@@ -15,7 +15,7 @@
 * copyright in this work, please see the NOTICE file in the top level
 * directory of this distribution.
 */
-package org.apache.abdera.util;
+package org.apache.abdera.i18n.text.io;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -27,7 +27,18 @@
 
 public class CompressionUtil {
 
-  public enum CompressionCodec { GZIP, XGZIP, DEFLATE }
+  public enum CompressionCodec { 
+    GZIP, 
+    XGZIP, 
+    DEFLATE;
+  
+    public static CompressionCodec value(String encoding) {
+      if (encoding == null)
+        throw new IllegalArgumentException();
+      return valueOf(encoding.toUpperCase().replaceAll("-", ""));
+    }
+  
+  }
   
   public static CompressionCodec getCodec(String name) {
     CompressionCodec codec = null;
@@ -84,4 +95,36 @@
     }
     return in;
   }
+  
+  public static InputStream getDecodingInputStream(
+    InputStream in, 
+    String ce) 
+      throws IOException {
+    String[] encodings = splitAndTrim(ce, ",", false);
+    for (int n = encodings.length -1; n >= 0; n--) {
+      CompressionCodec encoding = 
+        CompressionCodec.value(encodings[n]);
+      in = CompressionUtil
+        .getDecodingInputStream(
+          in, 
+          encoding);
+    }
+    return in;
+  }
+  
+  private static String unquote(String s) {
+    if (s == null || s.length() == 0) return s;
+    if (s.startsWith("\"")) s = s.substring(1);
+    if (s.endsWith("\"")) s = s.substring(0, s.length() - 1);
+    return s;
+  }
+
+  
+  public static String[] splitAndTrim(String value, String delim, boolean unquote) {
+    String[] headers = (unquote) ? unquote(value).split(delim) : value.split(delim);
+    for (int n = 0; n < headers.length; n++) {
+      headers[n] = headers[n].trim();
+    }
+    return headers;
+  }
 }

Propchange: abdera/java/trunk/dependencies/i18n/src/main/java/org/apache/abdera/i18n/text/io/CompressionUtil.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java (original)
+++ abdera/java/trunk/parser/src/main/java/org/apache/abdera/parser/stax/FOMParser.java Wed
May  6 16:10:11 2009
@@ -28,6 +28,7 @@
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.i18n.iri.IRI;
 import org.apache.abdera.i18n.text.Localizer;
+import org.apache.abdera.i18n.text.io.CompressionUtil;
 import org.apache.abdera.model.Document;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.parser.ParseException;
@@ -36,7 +37,6 @@
 import org.apache.abdera.parser.stax.util.FOMSniffingInputStream;
 import org.apache.abdera.parser.stax.util.FOMXmlRestrictedCharReader;
 import org.apache.abdera.util.AbstractParser;
-import org.apache.abdera.util.CompressionUtil;
 import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.util.StAXUtils;
 

Modified: abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java
(original)
+++ abdera/java/trunk/parser/src/test/java/org/apache/abdera/test/parser/EncodingTest.java
Wed May  6 16:10:11 2009
@@ -26,14 +26,14 @@
 import junit.framework.Assert;
 
 import org.apache.abdera.Abdera;
+import org.apache.abdera.i18n.text.io.CompressionUtil;
+import org.apache.abdera.i18n.text.io.CompressionUtil.CompressionCodec;
 import org.apache.abdera.model.Content;
 import org.apache.abdera.model.Document;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.Entry;
 import org.apache.abdera.parser.Parser;
 import org.apache.abdera.parser.ParserOptions;
-import org.apache.abdera.util.CompressionUtil;
-import org.apache.abdera.util.CompressionUtil.CompressionCodec;
 import org.apache.abdera.writer.WriterOptions;
 import org.junit.Test;
 

Modified: abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/context/AbstractResponseContext.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/context/AbstractResponseContext.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/context/AbstractResponseContext.java
(original)
+++ abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/context/AbstractResponseContext.java
Wed May  6 16:10:11 2009
@@ -27,11 +27,11 @@
 import javax.activation.MimeType;
 
 import org.apache.abdera.i18n.text.Localizer;
+import org.apache.abdera.i18n.text.Rfc2047Helper;
 import org.apache.abdera.i18n.text.UrlEncoding;
 import org.apache.abdera.i18n.text.CharUtils.Profile;
 import org.apache.abdera.protocol.server.ResponseContext;
 import org.apache.abdera.protocol.util.AbstractResponse;
-import org.apache.abdera.protocol.util.EncodingUtil;
 import org.apache.abdera.util.EntityTag;
 import org.apache.abdera.writer.Writer;
 
@@ -64,13 +64,13 @@
   }
   
   public ResponseContext setEncodedHeader(String name, String charset, String value) {
-    return setHeader(name, EncodingUtil.encode(value, charset));
+    return setHeader(name, Rfc2047Helper.encode(value, charset));
   }
   
   public ResponseContext setEncodedHeader(String name, String charset, String... vals) {
     Object[] evals = new Object[vals.length];
     for (int n = 0; n < vals.length; n++) {
-      evals[n] = EncodingUtil.encode(vals[n], charset);
+      evals[n] = Rfc2047Helper.encode(vals[n], charset);
     }
     return setHeader(name, evals);
   }
@@ -94,12 +94,12 @@
   }
   
   public ResponseContext addEncodedHeader(String name, String charset, String value) {
-    return addHeader(name, EncodingUtil.encode(value, charset));
+    return addHeader(name, Rfc2047Helper.encode(value, charset));
   }
   
   public ResponseContext addEncodedHeaders(String name, String charset, String... vals) {
     for (String value : vals) {
-      addHeader(name,EncodingUtil.encode(value, charset));
+      addHeader(name,Rfc2047Helper.encode(value, charset));
     }
     return this;
   }

Modified: abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/filters/CompressionFilter.java
URL: http://svn.apache.org/viewvc/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/filters/CompressionFilter.java?rev=772343&r1=772342&r2=772343&view=diff
==============================================================================
--- abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/filters/CompressionFilter.java
(original)
+++ abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/filters/CompressionFilter.java
Wed May  6 16:10:11 2009
@@ -22,14 +22,14 @@
 import java.io.OutputStream;
 import java.util.zip.DeflaterOutputStream;
 
+import org.apache.abdera.i18n.text.io.CompressionUtil;
+import org.apache.abdera.i18n.text.io.CompressionUtil.CompressionCodec;
 import org.apache.abdera.protocol.server.Filter;
 import org.apache.abdera.protocol.server.FilterChain;
 import org.apache.abdera.protocol.server.ProviderHelper;
 import org.apache.abdera.protocol.server.RequestContext;
 import org.apache.abdera.protocol.server.ResponseContext;
 import org.apache.abdera.protocol.server.context.ResponseContextWrapper;
-import org.apache.abdera.util.CompressionUtil;
-import org.apache.abdera.util.CompressionUtil.CompressionCodec;
 import org.apache.abdera.writer.Writer;
 
 /**



Mime
View raw message