Example usage for org.apache.commons.vfs2 FileName ROOT_PATH

List of usage examples for org.apache.commons.vfs2 FileName ROOT_PATH

Introduction

In this page you can find the example usage for org.apache.commons.vfs2 FileName ROOT_PATH.

Prototype

String ROOT_PATH

To view the source code for org.apache.commons.vfs2 FileName ROOT_PATH.

Click Source Link

Document

The absolute path of the root of a file system.

Usage

From source file:com.github.junrar.vfs2.provider.rar.RARFileProvider.java

/**
 * Creates a layered file system. This method is called if the file system
 * is not cached./*w ww  .  ja va  2s .co  m*/
 * 
 * @param scheme
 *            The URI scheme.
 * @param file
 *            The file to create the file system on top of.
 * @return The file system.
 */
@Override
protected FileSystem doCreateFileSystem(final String scheme, final FileObject file,
        final FileSystemOptions fileSystemOptions) throws FileSystemException {
    final AbstractFileName rootName = new LayeredFileName(scheme, file.getName(), FileName.ROOT_PATH,
            FileType.FOLDER);
    return new RARFileSystem(rootName, file, fileSystemOptions);
}

From source file:org.pentaho.big.data.kettle.plugins.hdfs.vfs.HadoopVfsFileChooserDialog.java

public void connect() {
    NamedCluster nc = getNamedClusterWidget().getSelectedNamedCluster();
    // The Named Cluster may be hdfs, maprfs or wasb.  We need to detect it here since the named
    // cluster was just selected.
    schemeName = "wasb".equals(nc.getStorageScheme()) ? "wasb" : "hdfs";

    FileObject root = rootFile;/*from   www . j a  va2s .  c om*/
    try {
        root = KettleVFS.getFileObject(nc.processURLsubstitution(FileName.ROOT_PATH,
                Spoon.getInstance().getMetaStore(), getVariableSpace()));
    } catch (KettleFileException exc) {
        showMessageAndLog(BaseMessages.getString(PKG, "HadoopVfsFileChooserDialog.error"),
                BaseMessages.getString(PKG, "HadoopVfsFileChooserDialog.Connection.error"), exc.getMessage());
    }

    vfsFileChooserDialog.setRootFile(root);
    vfsFileChooserDialog.setSelectedFile(root);
    rootFile = root;
}

From source file:org.renjin.appengine.AppEngineLocalFilesSystemProvider.java

@Override
public FileObject findFile(FileObject baseFile, String uri, FileSystemOptions properties)
        throws FileSystemException {

    // Parse the name
    final StringBuilder buffer = new StringBuilder(uri);
    String scheme = UriParser.extractScheme(uri, buffer);
    if (scheme == null) {
        scheme = "file";
    }//from   w w w .  j a va2 s.c  o  m

    UriParser.fixSeparators(buffer);

    FileType fileType = UriParser.normalisePath(buffer);
    final String path = buffer.toString();

    // Create the temp file system if it does not exist
    // FileSystem filesystem = findFileSystem( this, (Properties) null);
    FileSystem filesystem = findFileSystem(this, properties);
    if (filesystem == null) {
        final FileName rootName = getContext().parseURI(scheme + ":" + FileName.ROOT_PATH);

        filesystem = new AppEngineLocalFileSystem(rootName, rootFile.getAbsolutePath(), properties);
        addFileSystem(this, filesystem);
    }

    // Find the file
    return filesystem.resolveFile(path);
}

From source file:org.ysb33r.groovy.vfsplugin.cpio.CpioFileProvider.java

/**
 * Creates a layered file system.  This method is called if the file system
 * is not cached./*w w  w .j av a2  s .  c  om*/
 *
 * @param scheme The URI scheme.
 * @param file   The file to create the file system on top of.
 * @return The file system.
 */
@Override
protected FileSystem doCreateFileSystem(final String scheme, final FileObject file,
        final FileSystemOptions fileSystemOptions) throws FileSystemException {
    final AbstractFileName rootName = new LayeredFileName(scheme, file.getName(), FileName.ROOT_PATH,
            FileType.FOLDER);
    return new CpioFileSystem(rootName, file, fileSystemOptions);
}