/** * Creates a virtual file system. * * @param rootFile The FileObject to use. * @return The FileObject in the VirtualFileSystem. * @throws FileSystemException if an error occurs creating the file. */ @Override public FileObject createVirtualFileSystem(final FileObject rootFile) throws FileSystemException { return vfsProvider.createFileSystem(rootFile); }
/** * Close a VirtualFileSystem by removing it from the {@code #components} list of this provider. * <p> * This gets called from DefaultFileManager#_closeFileSystem. * * @param filesystem the file system remembered by this provider. */ void closeFileSystem(final FileSystem filesystem) { final AbstractFileSystem fs = (AbstractFileSystem) filesystem; removeComponent(fs); fs.close(); } }
/** * 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(); }
private boolean _tryCloseFileSystem(final FileSystem filesystem) { final FileProvider provider = providers.get(filesystem.getRootName().getScheme()); if (provider != null) { return ((AbstractFileProvider) provider).tryCloseFileSystem(filesystem); } else if (filesystem instanceof VirtualFileSystem) { // vfsProvider does not implement AbstractFileProvider vfsProvider.closeFileSystem(filesystem); } return true; } //[IntelliJ] no freezes on dispose ---------
/** * 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(); }
/** * Initializes this manager. * <p> * If no value for the following properties was specified, it will use the following defaults: * <ul> * <li>fileContentInfoFactory = new FileContentInfoFilenameFactory()</li> * <li>filesCache = new SoftRefFilesCache()</li> * <li>fileCacheStrategy = CacheStrategy.ON_RESOLVE</li> * </ul> * * @throws FileSystemException if an error occurs during initialization. */ public void init() throws FileSystemException { if (fileContentInfoFactory == null) { fileContentInfoFactory = new FileContentInfoFilenameFactory(); } if (filesCache == null) { // filesCache = new DefaultFilesCache(); filesCache = new SoftRefFilesCache(); } if (fileCacheStrategy == null) { fileCacheStrategy = CacheStrategy.ON_RESOLVE; } setupComponent(filesCache); vfsProvider = new VirtualFileProvider(); setupComponent(vfsProvider); init = true; }
/** * 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(); }
/** * Closes the given file system. * <p> * If you use VFS as singleton it is VERY dangerous to call this method * </p> * * @param filesystem The FileSystem to close. */ public void _closeFileSystem(final FileSystem filesystem) { final FileProvider provider = providers.get(filesystem.getRootName().getScheme()); if (provider != null) { ((AbstractFileProvider) provider).closeFileSystem(filesystem); } else if (filesystem instanceof VirtualFileSystem) { // vfsProvider does not implement AbstractFileProvider vfsProvider.closeFileSystem(filesystem); } }
/** * 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(); }
/** * Initializes this manager. * <p> * If no value for the following properties was specified, it will use the following defaults: * <ul> * <li>fileContentInfoFactory = new FileContentInfoFilenameFactory()</li> * <li>filesCache = new SoftRefFilesCache()</li> * <li>fileCacheStrategy = CacheStrategy.ON_RESOLVE</li> * </ul> * * @throws FileSystemException if an error occurs during initialization. */ public void init() throws FileSystemException { if (fileContentInfoFactory == null) { fileContentInfoFactory = new FileContentInfoFilenameFactory(); } if (filesCache == null) { // filesCache = new DefaultFilesCache(); filesCache = new SoftRefFilesCache(); } if (fileCacheStrategy == null) { fileCacheStrategy = CacheStrategy.ON_RESOLVE; } setupComponent(filesCache); vfsProvider = new VirtualFileProvider(); setupComponent(vfsProvider); init = true; }
/** * 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 an empty virtual file system. * * @param rootUri The URI to use as the root of the FileSystem. * @return A FileObject in the virtual FileSystem. * @throws FileSystemException if an error occurs. */ @Override public FileObject createVirtualFileSystem(final String rootUri) throws FileSystemException { return vfsProvider.createFileSystem(rootUri); }
/** * Closes the given file system. * <p> * If you use VFS as singleton it is VERY dangerous to call this method * </p> * * @param filesystem The FileSystem to close. */ public void _closeFileSystem(final FileSystem filesystem) { final FileProvider provider = providers.get(filesystem.getRootName().getScheme()); if (provider != null) { ((AbstractFileProvider) provider).closeFileSystem(filesystem); } else if (filesystem instanceof VirtualFileSystem) { // vfsProvider does not implement AbstractFileProvider vfsProvider.closeFileSystem(filesystem); } }
/** * Close a VirtualFileSystem by removing it from the {@code #components} list of this provider. * <p> * This gets called from DefaultFileManager#_closeFileSystem. * * @param filesystem the file system remembered by this provider. */ void closeFileSystem(final FileSystem filesystem) { final AbstractFileSystem fs = (AbstractFileSystem) filesystem; removeComponent(fs); fs.close(); } }
/** * 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(); }
/** * Initializes this manager. * <p> * If no value for the following properties was specified, it will use the following defaults: * <ul> * <li>fileContentInfoFactory = new FileContentInfoFilenameFactory()</li> * <li>filesCache = new SoftRefFilesCache()</li> * <li>fileCacheStrategy = CacheStrategy.ON_RESOLVE</li> * </ul> * * @throws FileSystemException if an error occurs during initialization. */ public void init() throws FileSystemException { if (fileContentInfoFactory == null) { fileContentInfoFactory = new FileContentInfoFilenameFactory(); } if (filesCache == null) { // filesCache = new DefaultFilesCache(); filesCache = new SoftRefFilesCache(); } if (fileCacheStrategy == null) { fileCacheStrategy = CacheStrategy.ON_RESOLVE; } setupComponent(filesCache); vfsProvider = new VirtualFileProvider(); setupComponent(vfsProvider); init = true; }
/** * 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 an empty virtual file system. * * @param rootUri The URI to use as the root of the FileSystem. * @return A FileObject in the virtual FileSystem. * @throws FileSystemException if an error occurs. */ @Override public FileObject createVirtualFileSystem(final String rootUri) throws FileSystemException { return vfsProvider.createFileSystem(rootUri); }
/** * Closes the given file system. * <p> * If you use VFS as singleton it is VERY dangerous to call this method * </p> * * @param filesystem The FileSystem to close. */ public void _closeFileSystem(final FileSystem filesystem) { final FileProvider provider = providers.get(filesystem.getRootName().getScheme()); if (provider != null) { ((AbstractFileProvider) provider).closeFileSystem(filesystem); } else if (filesystem instanceof VirtualFileSystem) { // vfsProvider does not implement AbstractFileProvider vfsProvider.closeFileSystem(filesystem); } }
/** * Close a VirtualFileSystem by removing it from the {@code #components} list of this provider. * <p> * This gets called from DefaultFileManager#_closeFileSystem. * * @param filesystem the file system remembered by this provider. */ void closeFileSystem(final FileSystem filesystem) { final AbstractFileSystem fs = (AbstractFileSystem) filesystem; removeComponent(fs); fs.close(); } }