chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r894693 - in /incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server: CMISObjectsCollection.java CMISTypesCollection.java
Date Wed, 30 Dec 2009 18:53:55 GMT
Author: fguillaume
Date: Wed Dec 30 18:53:49 2009
New Revision: 894693

URL: http://svn.apache.org/viewvc?rev=894693&view=rev
Log:
CMIS-87: decode URI parameters properly

Modified:
    incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java?rev=894693&r1=894692&r2=894693&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISObjectsCollection.java
Wed Dec 30 18:53:49 2009
@@ -32,6 +32,7 @@
 
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.i18n.text.UrlEncoding;
 import org.apache.abdera.model.AtomDate;
 import org.apache.abdera.model.Content;
 import org.apache.abdera.model.DateTime;
@@ -707,13 +708,7 @@
             name = "objectid";
         }
         String resourceName = request.getTarget().getParameter(name);
-        // TODO decode properly
-        resourceName = resourceName.replace("%3a", ":");
-        resourceName = resourceName.replace("%3A", ":");
-        resourceName = resourceName.replace("%20", " ");
-        resourceName = resourceName.replace("%2f", "/");
-        resourceName = resourceName.replace("%2F", "/");
-        return resourceName;
+        return UrlEncoding.decode(resourceName);
     }
 
     @Override

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java?rev=894693&r1=894692&r2=894693&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/CMISTypesCollection.java
Wed Dec 30 18:53:49 2009
@@ -25,6 +25,7 @@
 
 import org.apache.abdera.factory.Factory;
 import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.i18n.text.UrlEncoding;
 import org.apache.abdera.model.Content;
 import org.apache.abdera.model.Element;
 import org.apache.abdera.model.Entry;
@@ -301,11 +302,7 @@
     @Override
     public String getResourceName(RequestContext request) {
         String resourceName = request.getTarget().getParameter("typeid");
-        // TODO decode properly
-        resourceName = resourceName.replace("%3a", ":");
-        resourceName = resourceName.replace("%3A", ":");
-        resourceName = resourceName.replace("%20", " ");
-        return resourceName;
+        return UrlEncoding.decode(resourceName);
     }
 
     @Override



Mime
View raw message