Java URI to toDecodedString(URI uri)

Here you can find the source of toDecodedString(URI uri)

Description

Returns a string representation of the URI in a form suitable for human consumption.

License

Open Source License

Parameter

Parameter Description
uri The URI to return in string form

Return

the string form of the URI

Declaration

public static String toDecodedString(URI uri) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2005, 2009 IBM Corporation 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
 * // ww w .  j a v  a  2s  . c  o  m
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/

import java.net.URI;

public class Main {
    /**
     * Returns a string representation of the URI in a form suitable for human consumption.
     * 
     * <p>
     * The string returned by this method is equivalent to that returned by the
     * {@link URI#toString()} method except that all sequences of escaped octets are decoded.
     * </p>
     * 
     * @param uri The URI to return in string form
     * @return the string form of the URI
     * @since org.eclipse.core.filesystem 1.2
     */
    public static String toDecodedString(URI uri) {
        String scheme = uri.getScheme();
        String part = uri.getSchemeSpecificPart();
        if (scheme == null)
            return part;
        return scheme + ':' + part;
    }
}

Related

  1. extractOntologyNameUriFromRDF(String rdfString, boolean generateURI)
  2. extractParamsFromURI(String uri)
  3. extractS3Key(URI uri)
  4. extractTargetSystemFromUri(URI uri)
  5. extractURIFromText(String texto)
  6. toExistingFile(URI uri)
  7. toExternalForm(URI u)
  8. toFile(java.net.URI uri)
  9. toFile(String filenameOrFileURI)