Here you can find the source of decode(Object value)
Parameter | Description |
---|---|
value | url fragment |
public static String decode(Object value)
//package com.java2s; /******************************************************************************* * Copyright 2010-2016 CNES - CENTRE NATIONAL d'ETUDES SPATIALES * * This file is part of SITools2.//from www . j a v a 2 s .c o m * * SITools2 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * SITools2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with SITools2. If not, see <http://www.gnu.org/licenses/>. ******************************************************************************/ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; public class Main { /** * Decodes string encoded in UTF-8 (useful for request parameters, or url fragments) * @param value url fragment * @return decoded String */ public static String decode(Object value) { if (value == null) { return null; } try { return URLDecoder.decode(value.toString(), "UTF-8"); } catch (UnsupportedEncodingException e) { return null; } } }