List of usage examples for org.apache.commons.vfs2.provider UriParser canonicalizePath
public static void canonicalizePath(final StringBuilder buffer, final int offset, final int length, final FileNameParser fileNameParser) throws FileSystemException
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); }