From c755ecde63002344abc2ad191f8873f5dc319ab4 Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Tue, 3 Mar 2015 14:15:49 +0000 Subject: [PATCH] fixed bug in HttpResover git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@112321 82a268e6-3cf1-43bd-a215-b396298e98cf --- pom.xml | 2 +- .../datatransfer/resolver/http/HttpResolver.java | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index f532af7..86c7dc8 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ org.gcube.data.transfer uri-resolver - 1.2.0-SNAPSHOT + 1.3.0-SNAPSHOT war diff --git a/src/main/java/org/gcube/datatransfer/resolver/http/HttpResolver.java b/src/main/java/org/gcube/datatransfer/resolver/http/HttpResolver.java index bead527..440ed3a 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/http/HttpResolver.java +++ b/src/main/java/org/gcube/datatransfer/resolver/http/HttpResolver.java @@ -84,16 +84,24 @@ public class HttpResolver extends HttpServlet { //we should not unescape the filename with spaces + logger.debug("uri = "+uri); + int index= uri.indexOf("?"); if ( index!= -1) { + logger.debug("Found char ?"); String firsPart = uri.substring(0, index); String secondPart= uri.substring( index+1); - secondPart.replace(" ","+");//the char + is removed when the servlet is doing unescaping of the query paramenters, we just put it back + logger.debug("firsPart not chagend: "+firsPart); + logger.debug("replacing in smp-uri char space with char + ..."); + secondPart = secondPart.replace(" ","+");//the char + is removed when the servlet is doing unescaping of the query paramenters, we just put it back + logger.debug("new secondPart: "+secondPart); uri= firsPart+"?"+secondPart; } - else uri = uri.replace(" ","+");//the char + is removed when the servlet is doing unescaping of the query paramenters, we just put it back - + else { + logger.debug("Not found char ?"); + uri = uri.replace(" ","+");//the char + is removed when the servlet is doing unescaping of the query paramenters, we just put it back + } logger.debug("URI = "+ uri); InputStream in = null;