core/src/main/java/org/apache/commons/vfs2/provider/LayeredFileNameParser.java
/**
     * Pops the root prefix off a URI, which has had the scheme removed.
     */
Pops the root prefix off a URI, which has had the scheme removed.
Pops the root prefix off a URI which has had the scheme removed .
protected String extractRootName(final StringBuilder uri)
        throws FileSystemException
    {
        int maxlen = uri.length();
        int pos = maxlen - 1;
        for (; pos > 0 && uri.charAt(pos) != '!'; pos--)
        {
        }
        if (pos == 0 && uri.charAt(pos) != '!')
        {
            pos = maxlen;
        }
        String prefix = uri.substring(0, pos);
        if (pos < maxlen)
        {
            uri.delete(0, pos + 1);
        }
        else
        {
            uri.setLength(0);
        }
        return prefix;
    }
protected String extractRootName ( final StringBuilder uri ) throws FileSystemException { int maxlen = uri . length ( ) ; int pos = maxlen - 1 ; for ( ; pos > 0 && uri . charAt ( pos ) != '!' ; pos -- ) { } if ( pos == 0 && uri . charAt ( pos ) != '!' ) { pos = maxlen ; } String prefix = uri . substring ( 0 , pos ) ; if ( pos < maxlen ) { uri . delete ( 0 , pos + 1 ) ; } else { uri . setLength ( 0 ) ; } return prefix ; }
Pops the root prefix off a URI, which has had the scheme removed.
Pops the root prefix off a URI which has had the scheme removed .
// Looking for <name>!<abspath> (staring at the end) // not ! found, so take the whole path a root // e.g. zip:/my/zip/file.zip // Extract the name