Example usage for org.apache.commons.vfs2.provider UriParser canonicalizePath

List of usage examples for org.apache.commons.vfs2.provider UriParser canonicalizePath

Introduction

In this page you can find the example usage for org.apache.commons.vfs2.provider UriParser canonicalizePath.

Prototype

public static void canonicalizePath(final StringBuilder buffer, final int offset, final int length,
            final FileNameParser fileNameParser) throws FileSystemException 

Source Link

Usage

From source file:org.wso2.carbon.inbound.endpoint.protocol.file.MockFileNameParser.java

public FileName parseUri(VfsComponentContext context, FileName base, String filename)
        throws FileSystemException {
    StringBuilder name = new StringBuilder();
    String scheme = UriParser.extractScheme(filename.split("\\?")[0], name);
    if (scheme == null) {
        scheme = "test";
    }//from   ww  w  .j a va2 s.  c  o m

    UriParser.canonicalizePath(name, 0, name.length(), this);
    UriParser.fixSeparators(name);
    String rootFile = this.extractRootPrefix(filename, name);
    FileType fileType = UriParser.normalisePath(name);
    String path = name.toString();
    return new MockFileName(scheme, "", path, fileType);
}