diff options
author | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-10-21 10:11:50 +0200 |
---|---|---|
committer | Thomas Lenz <tlenz@iaik.tugraz.at> | 2016-10-21 10:11:50 +0200 |
commit | f4bc3a6fb1c1b9b07b74e2254d6acb71985d8c39 (patch) | |
tree | 443c3c3bd317d79a02c1ab641fe574c5a755e68f /common/src/main/java/at/gv/egovernment/moa/util/URLDecoder.java | |
parent | 77cdbbc4040fd6677d499757bbd96c33e9541603 (diff) | |
download | moa-id-spss-f4bc3a6fb1c1b9b07b74e2254d6acb71985d8c39.tar.gz moa-id-spss-f4bc3a6fb1c1b9b07b74e2254d6acb71985d8c39.tar.bz2 moa-id-spss-f4bc3a6fb1c1b9b07b74e2254d6acb71985d8c39.zip |
remove unused code
Diffstat (limited to 'common/src/main/java/at/gv/egovernment/moa/util/URLDecoder.java')
-rw-r--r-- | common/src/main/java/at/gv/egovernment/moa/util/URLDecoder.java | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/common/src/main/java/at/gv/egovernment/moa/util/URLDecoder.java b/common/src/main/java/at/gv/egovernment/moa/util/URLDecoder.java deleted file mode 100644 index 66739a7a4..000000000 --- a/common/src/main/java/at/gv/egovernment/moa/util/URLDecoder.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2003 Federal Chancellery Austria - * MOA-ID has been developed in a cooperation between BRZ, the Federal - * Chancellery Austria - ICT staff unit, and Graz University of Technology. - * - * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by - * the European Commission - subsequent versions of the EUPL (the "Licence"); - * You may not use this work except in compliance with the Licence. - * You may obtain a copy of the Licence at: - * http://www.osor.eu/eupl/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the Licence is distributed on an "AS IS" basis, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the Licence for the specific language governing permissions and - * limitations under the Licence. - * - * This product combines work with different licenses. See the "NOTICE" text - * file for details on the various modules and licenses. - * The "NOTICE" text file is part of the distribution. Any derivative works - * that you distribute must include a readable copy of the "NOTICE" text file. - */ - - -package at.gv.egovernment.moa.util; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.StringReader; -import java.io.UnsupportedEncodingException; - -/** - * Decodes an URL encoded String using a specified character encoding. - * Provides a function missing in JDK 1.3. - * @author Paul Ivancsics - * @version $Id$ - */ -public class URLDecoder { - - /** - * Decodes an <code>application/x-www-form-urlencoded</code> string using a specific encoding scheme. - * @param s the string to decode - * @param encoding name of character encoding - * @return the newly decoded string - * @throws UnsupportedEncodingException if the encoding is not supported - */ - public static String decode(String s, String encoding) throws UnsupportedEncodingException { - StringReader in = new StringReader(s); - ByteArrayOutputStream bout = new ByteArrayOutputStream(); - for (int b = read(in); b >= 0; b = read(in)) - bout.write(b); - return bout.toString(encoding); - } - /** - * Decodes the next byte from the string reader. - * @param in string reader - * @return the next byte decoded; - * -1 upon end of string, on erroneous data, and on any exception caught - * @todo syntax check on string - */ - private static int read(StringReader in) { - try { - int b = in.read(); - if (b == '+') - return ' '; - if (b == '%') { - char[] hex = new char[2]; - if (in.read(hex, 0, 2) >= 0) { - String hexString = new String(hex); - return Integer.valueOf(hexString, 16).intValue(); - } - else - return -1; - } - return b; - } - catch (IOException ex) { - return -1; - } - catch (NumberFormatException ex) { - return -1; - } - } -} |