Java URL Decode decode(String path)

Here you can find the source of decode(String path)

Description

decode

License

Open Source License

Declaration

private static String decode(String path) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2010 The Eclipse Foundation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://from w w w.j a v  a 2 s .  c o  m
 *     The Eclipse Foundation - initial API and implementation
 *******************************************************************************/

import java.io.UnsupportedEncodingException;

import java.net.URLDecoder;

public class Main {
    private static String decode(String path) {
        try {
            return path == null ? null : URLDecoder.decode(path, "UTF-8"); //$NON-NLS-1$
        } catch (UnsupportedEncodingException e) {
            //should not be possible
            return path;
        }
    }
}

Related

  1. decode(String content)
  2. decode(String encoded)
  3. decode(String encodeMsg)
  4. decode(String input)
  5. decode(String input)
  6. decode(String path, String encoding)
  7. decode(String raw)
  8. decode(String s)
  9. decode(String s)