Here you can find the source of decode(String encodedURI)
Parameter | Description |
---|---|
encodedURI | a parameter |
public static String decode(String encodedURI)
//package com.java2s; /**//from www .jav a 2 s. c o m * Copyright (C) 2012 MediaShelf <http://www.yourmediashelf.com/> * * This file is part of uuid-datepath-idmapper. * * uuid-datepath-idmapper is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * uuid-datepath-idmapper 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with uuid-datepath-idmapper. If not, see <http://www.gnu.org/licenses/>. */ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; public class Main { /** * * @param encodedURI * @return the decoded URI, as a String */ public static String decode(String encodedURI) { if (encodedURI.endsWith("%2E")) { encodedURI = encodedURI.substring(0, encodedURI.length() - 3) + "."; } try { return URLDecoder.decode(encodedURI, "UTF-8"); } catch (UnsupportedEncodingException wontHappen) { throw new RuntimeException(wontHappen); } } }