[ 
https://issues.apache.org/jira/browse/HADOOP-7531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13083186#comment-13083186
 ] 

Eli Collins commented on HADOOP-7531:
-------------------------------------

bq. Please elaborate because I'm not sure I follow your reasoning

These methods don't need to throw a checked exception. For comparison, the 
variants of jetty URIUtil#encodePath and java's URLEncoder#encode that don't 
take a charset do not throw UnsupportedEncodingException. We know "UTF-8" is a 
supported codec, ie the exception won't be thrown because these methods, like 
jetty/javas, don't throw URIException when explicitly given a supported codec. 
And if UTF-8 were not supported we'd never reach this code. Ie we could throw 
an assertion error here, the catch clause here is just to work around the 
weakness in this particular API. I'd rather use jetty's URIUtil than have every 
encode/decode throw an IOException.  

Matching servletName+"/" is reasonable since our pathspecs match servletName/*, 
will add the +"/".


> Add servlet util methods for handling paths in requests 
> --------------------------------------------------------
>
>                 Key: HADOOP-7531
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7531
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: util
>    Affects Versions: 0.23.0
>            Reporter: Eli Collins
>            Assignee: Eli Collins
>             Fix For: 0.23.0
>
>         Attachments: hadoop-7531-1.patch, hadoop-7531-1.patch, 
> hadoop-7531-2.patch, hadoop-7531-3.patch, hadoop-7531-4.patch
>
>
> Common side of HDFS-2235.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to