/** * 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(); }
/** * Removes a junction from this file system. * * @param junctionPoint The junction to remove. * @throws FileSystemException if an error occurs. */ @Override public void removeJunction(final String junctionPoint) throws FileSystemException { final FileName junctionName = getFileSystemManager().resolveName(getRootName(), junctionPoint); junctions.remove(junctionName); // TODO - remove from parents of junction point // TODO - detach all cached children of the junction point from their real file }
final FileName junctionName = getFileSystemManager().resolveName(getRootName(), junctionPoint); if (getJunctionForFile(junctionName) != null) { throw new FileSystemException("vfs.impl/nested-junction.error", junctionName); final DelegateFileObject junctionFile = (DelegateFileObject) getFileFromCache(junctionName); if (junctionFile != null) { junctionFile.setFile(targetFile); && parentName != null; childName = parentName, parentName = (AbstractFileName) parentName .getParent()) { DelegateFileObject file = (DelegateFileObject) getFileFromCache(parentName); if (file == null) { file = new DelegateFileObject(parentName, this, null); putFileToCache(file); } else { done = file.exists();
/** * 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 file object. This method is called only if the requested file is not cached. */ @Override protected FileObject createFile(final AbstractFileName name) throws Exception { // Find the file that the name points to final FileName junctionPoint = getJunctionForFile(name); final FileObject file; if (junctionPoint != null) { // Resolve the real file final FileObject junctionFile = junctions.get(junctionPoint); final String relName = junctionPoint.getRelativeName(name); file = junctionFile.resolveFile(relName, NameScope.DESCENDENT_OR_SELF); } else { file = null; } // Return a wrapper around the file return new DelegateFileObject(name, this, file); }
throws FileSystemException final FileName junctionName = getFileSystemManager().resolveName(getRootName(), junctionPoint); if (getJunctionForFile(junctionName) != null) final DelegateFileObject junctionFile = (DelegateFileObject) getFileFromCache(junctionName); if (junctionFile != null) childName = parentName, parentName = (AbstractFileName) parentName.getParent()) DelegateFileObject file = (DelegateFileObject) getFileFromCache(parentName); if (file == null) putFileToCache(file);
/** * 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 file object. This method is called only if the requested file is not cached. */ @Override protected FileObject createFile(final AbstractFileName name) throws Exception { // Find the file that the name points to final FileName junctionPoint = getJunctionForFile(name); final FileObject file; if (junctionPoint != null) { // Resolve the real file final FileObject junctionFile = junctions.get(junctionPoint); final String relName = junctionPoint.getRelativeName(name); file = junctionFile.resolveFile(relName, NameScope.DESCENDENT_OR_SELF); } else { file = null; } // Return a wrapper around the file return new DelegateFileObject(name, this, file); }
final FileName junctionName = getFileSystemManager().resolveName(getRootName(), junctionPoint); if (getJunctionForFile(junctionName) != null) { throw new FileSystemException("vfs.impl/nested-junction.error", junctionName); final DelegateFileObject junctionFile = (DelegateFileObject) getFileFromCache(junctionName); if (junctionFile != null) { junctionFile.setFile(targetFile); && parentName != null; childName = parentName, parentName = (AbstractFileName) parentName .getParent()) { DelegateFileObject file = (DelegateFileObject) getFileFromCache(parentName); if (file == null) { file = new DelegateFileObject(parentName, this, null); putFileToCache(file); } else { done = file.exists();
/** * 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 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(); }
/** * Removes a junction from this file system. * * @param junctionPoint The junction to remove. * @throws FileSystemException if an error occurs. */ @Override public void removeJunction(final String junctionPoint) throws FileSystemException { final FileName junctionName = getFileSystemManager().resolveName(getRootName(), junctionPoint); junctions.remove(junctionName); // TODO - remove from parents of junction point // TODO - detach all cached children of the junction point from their real file }
/** * Creates a file object. This method is called only if the requested file is not cached. */ @Override protected FileObject createFile(final AbstractFileName name) throws Exception { // Find the file that the name points to final FileName junctionPoint = getJunctionForFile(name); final FileObject file; if (junctionPoint != null) { // Resolve the real file final FileObject junctionFile = junctions.get(junctionPoint); final String relName = junctionPoint.getRelativeName(name); file = junctionFile.resolveFile(relName, NameScope.DESCENDENT_OR_SELF); } else { file = null; } // Return a wrapper around the file return new DelegateFileObject(name, this, file); }
final FileName junctionName = getFileSystemManager().resolveName(getRootName(), junctionPoint); if (getJunctionForFile(junctionName) != null) { throw new FileSystemException("vfs.impl/nested-junction.error", junctionName); final DelegateFileObject junctionFile = (DelegateFileObject) getFileFromCache(junctionName); if (junctionFile != null) { junctionFile.setFile(targetFile); && parentName != null; childName = parentName, parentName = (AbstractFileName) parentName .getParent()) { DelegateFileObject file = (DelegateFileObject) getFileFromCache(parentName); if (file == null) { file = new DelegateFileObject(parentName, this, null); putFileToCache(file); } else { done = file.exists();
/** * 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 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(); }
/** * Removes a junction from this file system. * * @param junctionPoint The junction to remove. * @throws FileSystemException if an error occurs. */ @Override public void removeJunction(final String junctionPoint) throws FileSystemException { final FileName junctionName = getFileSystemManager().resolveName(getRootName(), junctionPoint); junctions.remove(junctionName); // TODO - remove from parents of junction point // TODO - detach all cached children of the junction point from their real file }
/** * Creates a file object. This method is called only if the requested * file is not cached. */ @Override protected FileObject createFile(final AbstractFileName name) throws Exception { // Find the file that the name points to final FileName junctionPoint = getJunctionForFile(name); final FileObject file; if (junctionPoint != null) { // Resolve the real file final FileObject junctionFile = junctions.get(junctionPoint); final String relName = junctionPoint.getRelativeName(name); file = junctionFile.resolveFile(relName, NameScope.DESCENDENT_OR_SELF); } else { file = null; } // Return a wrapper around the file return new DelegateFileObject(name, this, file); }
/** * 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(); }
/** * Removes a junction from this file system. * @param junctionPoint The junction to remove. * @throws FileSystemException if an error occurs. */ @Override public void removeJunction(final String junctionPoint) throws FileSystemException { final FileName junctionName = getFileSystemManager().resolveName(getRootName(), junctionPoint); junctions.remove(junctionName); // TODO - remove from parents of junction point // TODO - detach all cached children of the junction point from their real file }