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
feature/18038
Francesco Mangiacrapa 9 years ago
parent 71a92b3232
commit c755ecde63

@ -8,7 +8,7 @@
</parent>
<groupId>org.gcube.data.transfer</groupId>
<artifactId>uri-resolver</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>1.3.0-SNAPSHOT</version>
<packaging>war</packaging>
<properties>

@ -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;

Loading…
Cancel
Save