Java Code Examples for org.apache.commons.vfs2.FileName#ROOT_PATH

The following examples show how to use org.apache.commons.vfs2.FileName#ROOT_PATH . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MimeFileProvider.java    From commons-vfs with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the file system.
 */
@Override
protected FileSystem doCreateFileSystem(final String scheme, final FileObject file,
        final FileSystemOptions fileSystemOptions) throws FileSystemException {
    final FileName name = new LayeredFileName(scheme, file.getName(), FileName.ROOT_PATH, FileType.FOLDER);
    return new MimeFileSystem(name, file, fileSystemOptions);
}
 
Example 2
Source File: TarFileProvider.java    From commons-vfs with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a layered file system. This method is called if the file system is not cached.
 *
 * @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 TarFileSystem(rootName, file, fileSystemOptions);
}
 
Example 3
Source File: ZipFileProvider.java    From commons-vfs with Apache License 2.0 3 votes vote down vote up
/**
 * Creates a layered file system. This method is called if the file system is
 * not cached.
 *
 * @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 ZipFileSystem(rootName, file, fileSystemOptions);
}
 
Example 4
Source File: JarFileProvider.java    From commons-vfs with Apache License 2.0 3 votes vote down vote up
/**
 * Creates a layered file system. This method is called if the file system is not cached.
 *
 * @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 name = new LayeredFileName(scheme, file.getName(), FileName.ROOT_PATH, FileType.FOLDER);
    return new JarFileSystem(name, file, fileSystemOptions);
}
 
Example 5
Source File: CompressedFileFileProvider.java    From commons-vfs with Apache License 2.0 3 votes vote down vote up
/**
 * Creates a layered file system. This method is called if the file system is not cached.
 *
 * @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 FileName name = new LayeredFileName(scheme, file.getName(), FileName.ROOT_PATH, FileType.FOLDER);
    return createFileSystem(name, file, fileSystemOptions);
}
 
Example 6
Source File: VirtualFileProvider.java    From commons-vfs with Apache License 2.0 3 votes vote down vote up
/**
 * Creates an empty virtual file system.
 *
 * @param rootUri The root of the file system.
 * @return A FileObject in the FileSystem.
 * @throws FileSystemException if an error occurs.
 */
public FileObject createFileSystem(final String rootUri) throws FileSystemException {
    final AbstractFileName rootName = new VirtualFileName(rootUri, FileName.ROOT_PATH, FileType.FOLDER);
    final VirtualFileSystem fs = new VirtualFileSystem(rootName, null);
    addComponent(fs);
    return fs.getRoot();
}