/** * Return the FileSystemManager used to instantiate this filesystem. * * @return the FileSystemManager. */ @Override public FileSystemManager getFileSystemManager() { return getContext().getFileSystemManager(); }
/** * Return the FileSystemManager used to instantiate this filesystem. * * @return the FileSystemManager. */ @Override public FileSystemManager getFileSystemManager() { return getContext().getFileSystemManager(); }
/** * Return the FileSystemManager used to instantiate this filesystem. * @return the FileSystemManager. */ @Override public FileSystemManager getFileSystemManager() { return getContext().getFileSystemManager(); }
/** * Return the FileSystemManager used to instantiate this filesystem. * * @return the FileSystemManager. */ @Override public FileSystemManager getFileSystemManager() { return getContext().getFileSystemManager(); }
private FilesCache getCache() { FilesCache files; files = getContext().getFileSystemManager().getFilesCache(); if (files == null) { throw new RuntimeException(Messages.getString("vfs.provider/files-cache-missing.error")); } return files; }
private FilesCache getCache() { FilesCache files; files = getContext().getFileSystemManager().getFilesCache(); if (files == null) { throw new RuntimeException(Messages.getString("vfs.provider/files-cache-missing.error")); } return files; }
private FilesCache getCache() { FilesCache files; files = getContext().getFileSystemManager().getFilesCache(); if (files == null) { throw new RuntimeException(Messages.getString("vfs.provider/files-cache-missing.error")); } return files; }
private FilesCache getCache() { FilesCache files; files = getContext().getFileSystemManager().getFilesCache(); if (files == null) { throw new RuntimeException(Messages.getString("vfs.provider/files-cache-missing.error")); } return files; }
/** * Locates a file object, by absolute URI. * * @param baseFile The base FileObject. * @param uri The file to find. * @param fileSystemOptions The options for the FileSystem. * @return A FileObject for the located file. * @throws FileSystemException if an error occurs. */ @Override public FileObject findFile(final FileObject baseFile, final String uri, final FileSystemOptions fileSystemOptions) throws FileSystemException { final StringBuilder buf = new StringBuilder(INITIAL_BUFSZ); UriParser.extractScheme(uri, buf); final String[] schemes = getSchemes(); for (final String scheme : schemes) { buf.insert(0, ":"); buf.insert(0, scheme); } final FileObject fo = getContext().getFileSystemManager().resolveFile(buf.toString(), fileSystemOptions); return fo; } }
/** * Locates a file object, by absolute URI. * * @param baseFile The base file. * @param uri The URI of the file to locate. * @param fileSystemOptions The FileSystem options. * @return the FileObject. * @throws FileSystemException if an error occurs. */ @Override public FileObject findFile(final FileObject baseFile, final String uri, final FileSystemOptions fileSystemOptions) throws FileSystemException { final StringBuilder buf = new StringBuilder(BUFFER_SIZE); UriParser.extractScheme(uri, buf); final String resourceName = buf.toString(); ClassLoader cl = ResourceFileSystemConfigBuilder.getInstance().getClassLoader(fileSystemOptions); if (cl == null) { cl = getClass().getClassLoader(); } final URL url = cl.getResource(resourceName); if (url == null) { throw new FileSystemException("vfs.provider.url/badly-formed-uri.error", uri); } return getContext().getFileSystemManager().resolveFile(url.toExternalForm()); }
/** * Locates a file object, by absolute URI. * * @param baseFile The base FileObject. * @param uri The file to find. * @param fileSystemOptions The options for the FileSystem. * @return A FileObject for the located file. * @throws FileSystemException if an error occurs. */ @Override public FileObject findFile(final FileObject baseFile, final String uri, final FileSystemOptions fileSystemOptions) throws FileSystemException { final StringBuilder buf = new StringBuilder(INITIAL_BUFSZ); UriParser.extractScheme(VFS.getManager().getSchemes(), uri, buf); final String[] schemes = getSchemes(); for (final String scheme : schemes) { buf.insert(0, ":"); buf.insert(0, scheme); } final FileObject fo = getContext().getFileSystemManager().resolveFile(buf.toString(), fileSystemOptions); return fo; } }
@Override public FileName parseUri(final VfsComponentContext context, final FileName base, final String uri) throws FileSystemException { final StringBuilder name = new StringBuilder(); // Extract the scheme String scheme = UriParser.extractScheme(context.getFileSystemManager().getSchemes(), uri, name); if (scheme == null) { scheme = "file"; } // Remove encoding, and adjust the separators UriParser.canonicalizePath(name, 0, name.length(), this); UriParser.fixSeparators(name); // Extract the root prefix final String rootFile = extractRootPrefix(uri, name); // Normalise the path final FileType fileType = UriParser.normalisePath(name); final String path = name.toString(); return createFileName(scheme, rootFile, path, fileType); }
/** * Locates a file from its parsed URI. * * @param name The file name. * @param fileSystemOptions FileSystem options. * @return A FileObject associated with the file. * @throws FileSystemException if an error occurs. */ protected FileObject findFile(final FileName name, final FileSystemOptions fileSystemOptions) throws FileSystemException { // Check in the cache for the file system final FileName rootName = getContext().getFileSystemManager().resolveName(name, FileName.ROOT_PATH); final FileSystem fs = getFileSystem(rootName, fileSystemOptions); // Locate the file // return fs.resolveFile(name.getPath()); return fs.resolveFile(name); }
/** * Locates a file from its parsed URI. * * @param name The file name. * @param fileSystemOptions FileSystem options. * @return A FileObject associated with the file. * @throws FileSystemException if an error occurs. */ protected FileObject findFile(final FileName name, final FileSystemOptions fileSystemOptions) throws FileSystemException { // Check in the cache for the file system final FileName rootName = getContext().getFileSystemManager().resolveName(name, FileName.ROOT_PATH); final FileSystem fs = getFileSystem(rootName, fileSystemOptions); // Locate the file // return fs.resolveFile(name.getPath()); return fs.resolveFile(name); }
/** * Locates a file from its parsed URI. * * @param name The file name. * @param fileSystemOptions FileSystem options. * @return A FileObject associated with the file. * @throws FileSystemException if an error occurs. */ protected FileObject findFile(final FileName name, final FileSystemOptions fileSystemOptions) throws FileSystemException { // Check in the cache for the file system final FileName rootName = getContext().getFileSystemManager().resolveName(name, FileName.ROOT_PATH); final FileSystem fs = getFileSystem(rootName, fileSystemOptions); // Locate the file // return fs.resolveFile(name.getPath()); return fs.resolveFile(name); }
/** * Locates a file from its parsed URI. * @param name The file name. * @param fileSystemOptions FileSystem options. * @return A FileObject associated with the file. * @throws FileSystemException if an error occurs. */ protected FileObject findFile(final FileName name, final FileSystemOptions fileSystemOptions) throws FileSystemException { // Check in the cache for the file system final FileName rootName = getContext().getFileSystemManager().resolveName(name, FileName.ROOT_PATH); final FileSystem fs = getFileSystem(rootName, fileSystemOptions); // Locate the file // return fs.resolveFile(name.getPath()); return fs.resolveFile(name); }
/** * Creates a virtual file system, with the supplied file as its root. * * @param rootFile The root of the file system. * @return A FileObject in the FileSystem. * @throws FileSystemException if an error occurs. */ public FileObject createFileSystem(final FileObject rootFile) throws FileSystemException { final AbstractFileName rootName = (AbstractFileName) getContext().getFileSystemManager() .resolveName(rootFile.getName(), FileName.ROOT_PATH); final VirtualFileSystem fs = new VirtualFileSystem(rootName, rootFile.getFileSystem().getFileSystemOptions()); addComponent(fs); fs.addJunction(FileName.ROOT_PATH, rootFile); return fs.getRoot(); }
/** * Creates a virtual file system, with the supplied file as its root. * * @param rootFile The root of the file system. * @return A FileObject in the FileSystem. * @throws FileSystemException if an error occurs. */ public FileObject createFileSystem(final FileObject rootFile) throws FileSystemException { final AbstractFileName rootName = (AbstractFileName) getContext().getFileSystemManager() .resolveName(rootFile.getName(), FileName.ROOT_PATH); final VirtualFileSystem fs = new VirtualFileSystem(rootName, rootFile.getFileSystem().getFileSystemOptions()); addComponent(fs); fs.addJunction(FileName.ROOT_PATH, rootFile); return fs.getRoot(); }
/** * Creates a virtual file system, with the supplied file as its root. * * @param rootFile The root of the file system. * @return A FileObject in the FileSystem. * @throws FileSystemException if an error occurs. */ public FileObject createFileSystem(final FileObject rootFile) throws FileSystemException { final AbstractFileName rootName = (AbstractFileName) getContext().getFileSystemManager() .resolveName(rootFile.getName(), FileName.ROOT_PATH); final VirtualFileSystem fs = new VirtualFileSystem(rootName, rootFile.getFileSystem().getFileSystemOptions()); addComponent(fs); fs.addJunction(FileName.ROOT_PATH, rootFile); return fs.getRoot(); }
/** * Creates a virtual file system, with the supplied file as its root. * * @param rootFile The root of the file system. * @return A FileObject in the FileSystem. * @throws FileSystemException if an error occurs. */ public FileObject createFileSystem(final FileObject rootFile) throws FileSystemException { final AbstractFileName rootName = (AbstractFileName) getContext().getFileSystemManager().resolveName(rootFile.getName(), FileName.ROOT_PATH); final VirtualFileSystem fs = new VirtualFileSystem(rootName, rootFile.getFileSystem().getFileSystemOptions()); addComponent(fs); fs.addJunction(FileName.ROOT_PATH, rootFile); return fs.getRoot(); }