abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r561147 - in /incubator/abdera/java/trunk: core/src/main/java/org/apache/abdera/util/EntityTag.java protocol/src/main/java/org/apache/abdera/protocol/util/AbstractRequest.java
Date Mon, 30 Jul 2007 22:08:44 GMT
Author: jmsnell
Date: Mon Jul 30 15:08:43 2007
New Revision: 561147

URL: http://svn.apache.org/viewvc?view=rev&rev=561147
Log:
Heh.. forgot that we already had a parseTags method on EntityTag.  It was buggy 
anyway, tho.

Modified:
    incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java
    incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractRequest.java

Modified: incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java?view=diff&rev=561147&r1=561146&r2=561147
==============================================================================
--- incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java (original)
+++ incubator/abdera/java/trunk/core/src/main/java/org/apache/abdera/util/EntityTag.java Mon
Jul 30 15:08:43 2007
@@ -45,11 +45,10 @@
   public static EntityTag[] parseTags(String entity_tags) {
     if (entity_tags == null || entity_tags.length() == 0)
       return new EntityTag[0];
+    String[] tags = entity_tags.split("((?<=\")\\s*,\\s*(?=\"))");
     List<EntityTag> etags = new ArrayList<EntityTag>();
-    String[] tags = entity_tags.split(",");
     for (String tag : tags) {
-      tag = tag.trim();
-      etags.add(parse(tag));
+      etags.add(EntityTag.parse(tag.trim()));
     }
     return etags.toArray(new EntityTag[etags.size()]);
   }
@@ -203,17 +202,6 @@
     return EntityTag.matches(etag, etag2);
   }
 
-  public static EntityTag[] parseList(String list) {
-    if (list == null || list.length() == 0)
-      return new EntityTag[0];
-    String[] tags = list.split("((?<=\")\\s*,\\s*(?=\"))");
-    List<EntityTag> etags = new ArrayList<EntityTag>();
-    for (String tag : tags) {
-      etags.add(EntityTag.parse(tag));
-    }
-    return etags.toArray(new EntityTag[etags.size()]);
-  }
-  
   public static String toString(EntityTag... tags) {
     StringBuffer buf = new StringBuffer();
     for (EntityTag tag : tags) {

Modified: incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractRequest.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractRequest.java?view=diff&rev=561147&r1=561146&r2=561147
==============================================================================
--- incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractRequest.java
(original)
+++ incubator/abdera/java/trunk/protocol/src/main/java/org/apache/abdera/protocol/util/AbstractRequest.java
Mon Jul 30 15:08:43 2007
@@ -68,7 +68,7 @@
   }
 
   public EntityTag[] getIfMatch() {
-    return EntityTag.parseList(getHeader("If-Match"));
+    return EntityTag.parseTags(getHeader("If-Match"));
   }
 
   public Date getIfModifiedSince() {
@@ -76,7 +76,7 @@
   }
 
   public EntityTag[] getIfNoneMatch() {
-    return EntityTag.parseList(getHeader("If-None-Match"));
+    return EntityTag.parseTags(getHeader("If-None-Match"));
   }
 
   public Date getIfUnmodifiedSince() {



Mime
View raw message