View Javadoc

1   package com.atlassian.sal.core.util;
2   
3   import org.apache.commons.httpclient.URIException;
4   
5   /**
6    * Wrapper around {@link org.apache.commons.httpclient.util.URIUtil} to avoid silly checked exceptions.
7    */
8   public class URIUtil
9   {
10      public static String encodeWithinQuery(String query)
11      {
12          try
13          {
14              return org.apache.commons.httpclient.util.URIUtil.encodeWithinQuery(query);
15          }
16          catch (URIException e)
17          {
18              throw new RuntimeException(e);
19          }
20      }
21  
22      public static String decode(String queryString)
23      {
24          try
25          {
26              return org.apache.commons.httpclient.util.URIUtil.decode(queryString);
27          }
28          catch (URIException e)
29          {
30              throw new RuntimeException(e);
31          }
32      }
33  }