1 16 package org.outerj.daisy.frontend.util; 17 18 import org.apache.commons.httpclient.util.URIUtil; 19 import org.apache.commons.httpclient.URIException; 20 21 public class EncodingUtil { 22 public static String encodePath(String path) { 23 try { 24 return URIUtil.encodePath(path, "UTF-8"); 25 } catch (URIException e) { 26 throw new RuntimeException ("Problem encoding path " + path, e); 27 } 28 } 29 30 public static String encodePathQuery(String pathQuery) { 31 try { 32 return URIUtil.encodePathQuery(pathQuery, "UTF-8"); 33 } catch (URIException e) { 34 throw new RuntimeException ("Problem encoding path+query " + pathQuery, e); 35 } 36 } 37 } 38 | Popular Tags |