public static String normalizePath(URL url, char separatorChar) {

        // get the path part from the URL
        String path = new File(url.getPath()).getAbsolutePath();
        // trick to get the OS default encoding, taken from the official Java i18n FAQ
        String systemEncoding = (new OutputStreamWriter(new ByteArrayOutputStream())).getEncoding();
        // decode url in order to remove spaces and escaped chars from path
        return CmsFileUtil.normalizePath(CmsEncoder.decode(path, systemEncoding), separatorChar);
    }
public static String normalizePath ( URL url , char separatorChar ) { String path = new File ( url . getPath ( ) ) . getAbsolutePath ( ) ; String systemEncoding = ( new OutputStreamWriter ( new ByteArrayOutputStream ( ) ) ) . getEncoding ( ) ; return CmsFileUtil . normalizePath ( CmsEncoder . decode ( path , systemEncoding ) , separatorChar ) ; }
Returns the normalized file path created from the given URL.<p>

The path part {@link URL#getPath()} is used, unescaped and
normalized using {@link #normalizePath(String, char)}.<p>

@param url the URL to extract the path information from
@param separatorChar the file separator char to use, for example {@link File#separatorChar}

@return the normalized file path created from the given URL