1 11 package org.eclipse.update.internal.configurator; 12 13 import java.io.UnsupportedEncodingException ; 14 import java.net.URLDecoder ; 15 16 public class UpdateURLDecoder { 17 static boolean init=false; 18 static boolean useEnc=true; 19 20 public static String decode(String s, String enc) throws UnsupportedEncodingException { 21 if (!init) { 22 init = true; 23 try { 24 return URLDecoder.decode(s, enc); 25 } catch (NoSuchMethodError e) { 26 useEnc=false; 27 } 28 } 29 30 if (useEnc) { 31 return URLDecoder.decode(s, enc); 32 } 33 return URLDecoder.decode(s); 34 } 35 36 } 37 | Popular Tags |