core/src/main/java/org/apache/commons/vfs2/provider/url/UrlFileNameParser.java
/**
     * This method counts the slashes after the scheme.
     *
     * @param filename The file name.
     * @return number of slashes
     */
This method counts the slashes after the scheme.
@param filename The file name.
@return number of slashes
This method counts the slashes after the scheme . @param filename The file name . @return number of slashes
protected int countSlashes(final String filename)
    {
        int state = 0;
        int nuofSlash = 0;
        for (int pos = 0; pos < filename.length(); pos++)
        {
            char c = filename.charAt(pos);
            if (state == 0)
            {
                if (c >= 'a' && c <= 'z')
                {
                    continue;
                }
                if (c == ':')
                {
                    state++;
                    continue;
                }
            }
            else if (state == 1)
            {
                if (c == '/')
                {
                    nuofSlash++;
                }
                else
                {
                    return nuofSlash;
                }
            }
        }
        return nuofSlash;
    }
protected int countSlashes ( final String filename ) { int state = 0 ; int nuofSlash = 0 ; for ( int pos = 0 ; pos < filename . length ( ) ; pos ++ ) { char c = filename . charAt ( pos ) ; if ( state == 0 ) { if ( c >= 'a' && c <= 'z' ) { continue ; } if ( c == ':' ) { state ++ ; continue ; } } else if ( state == 1 ) { if ( c == '/' ) { nuofSlash ++ ; } else { return nuofSlash ; } } } return nuofSlash ; }
This method counts the slashes after the scheme.
This method counts the slashes after the scheme .