Example usage for org.apache.commons.vfs.provider.url UrlFileNameParser UrlFileNameParser

List of usage examples for org.apache.commons.vfs.provider.url UrlFileNameParser UrlFileNameParser

Introduction

In this page you can find the example usage for org.apache.commons.vfs.provider.url UrlFileNameParser UrlFileNameParser.

Prototype

public UrlFileNameParser() 

Source Link

Usage

From source file:org.pentaho.di.trans.steps.hadoopfileinput.HadoopFileInputMeta.java

public String getUrlPath(String incomingURL) {
    String path = null;// www. ja  v  a2s . com
    try {
        String noVariablesURL = incomingURL.replaceAll("[${}]", "/");
        UrlFileNameParser parser = new UrlFileNameParser();
        FileName fileName = parser.parseUri(null, null, noVariablesURL);
        String root = fileName.getRootURI();
        path = incomingURL.substring(root.length() - 1);
    } catch (FileSystemException e) {
        path = null;
    }
    return path;
}