blob: 6f4079d8a60e68d437c2b49f9275dde1c9cd60f6 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.update.internal.configurator;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
public class UpdateURLDecoder {
static boolean init=false;
static boolean useEnc=true;
public static String decode(String s, String enc) throws UnsupportedEncodingException {
if (!init) {
init = true;
try {
return URLDecoder.decode(s, enc);
} catch (NoSuchMethodError e) {
useEnc=false;
}
}
if (useEnc) {
return URLDecoder.decode(s, enc);
} else {
return URLDecoder.decode(s);
}
}
}