addFileSystem(key, fs); return fs.resolveFile(url.getPath());
public ZipFileSystem(final FileName rootName, final FileObject parentLayer, final FileSystemOptions fileSystemOptions) throws FileSystemException { super(rootName, parentLayer, fileSystemOptions); // Make a local copy of the file file = parentLayer.getFileSystem().replicateFile(parentLayer, Selectors.SELECT_SELF); // Open the Zip file if (!file.exists()) { // Don't need to do anything zipFile = null; return; } // zipFile = createZipFile(this.file); }
/** * * @param file */ public DefaultFileOperations(final FileObject file) { fileObject = file; fsmanager = file.getFileSystem().getFileSystemManager(); }
private FileObject getLinkDestination() throws FileSystemException { if (linkDestination == null) { final String path = this.fileInfo.getLink(); FileName relativeTo = getName().getParent(); if (relativeTo == null) { relativeTo = getName(); } FileName linkDestinationName = getFileSystem().getFileSystemManager().resolveName(relativeTo, path); linkDestination = getFileSystem().resolveFile(linkDestinationName); } return linkDestination; }
/** * Creates a layered file system. */ public synchronized FileObject createFileSystem(final String scheme, final FileObject file, final FileSystemOptions fileSystemOptions) throws FileSystemException { // Check if cached final FileName rootName = file.getName(); FileSystem fs = findFileSystem(rootName, null); if (fs == null) { // Create the file system fs = doCreateFileSystem(scheme, file, fileSystemOptions); addFileSystem(rootName, fs); } return fs.getRoot(); }
child.getFileSystem().addListener(child, this.fm.getFileListener()); child.getFileSystem().removeListener(child, this.fm.getFileListener());
/** * Resolves a URI, relative to a base file. */ public FileObject resolveFile(final FileObject baseFile, final String uri) throws FileSystemException { return resolveFile(baseFile, uri, baseFile == null ? null : baseFile .getFileSystem().getFileSystemOptions()); }
public DelegateFileObject(final FileName name, final AbstractFileSystem fileSystem, final FileObject file) throws FileSystemException { super(name, fileSystem); this.file = file; if (file != null) { file.getFileSystem().addListener(file, this); } }
FileObject parentLayer = file.getFileSystem().getParentLayer(); if (parentLayer == null) parent = parent.getFileSystem().getParentLayer())
.resolveFile( getFileSystem().getFileSystemManager().resolveName( getName(), UriParser.encode(name), NameScope.CHILD));
io.info("Readable: {}", file.isReadable()); io.info("Writeable: {}", file.isWriteable()); io.info("Root path: {}", file.getFileSystem().getRoot().getName().getPath());
/** * Adds a file system to those cached by this provider. The file system * may implement {@link VfsComponent}, in which case it is initialised. */ protected void addFileSystem(final Comparable key, final FileSystem fs) throws FileSystemException { // Add to the cache addComponent(fs); FileSystemKey treeKey = new FileSystemKey(key, fs.getFileSystemOptions()); ((AbstractFileSystem) fs).setCacheKey(treeKey); synchronized (this) { fileSystems.put(treeKey, fs); } }
/** * Attaches or detaches the target file. */ public void setFile(final FileObject file) throws Exception { final FileType oldType = doGetType(); if (file != null) { file.getFileSystem().addListener(file, this); } this.file = file; maybeTypeChanged(oldType); }
/** * Locates a file object, by absolute URI. */ public synchronized FileObject findFile(final FileObject baseFile, final String uri, final FileSystemOptions fileSystemOptions) throws FileSystemException { try { final URL url = new URL(uri); URL rootUrl = new URL(url, "/"); final String key = this.getClass().getName() + rootUrl.toString(); FileSystem fs = findFileSystem(key, fileSystemOptions); if (fs == null) { String extForm = rootUrl.toExternalForm(); final FileName rootName = getContext().parseURI(extForm); // final FileName rootName = // new BasicFileName(rootUrl, FileName.ROOT_PATH); fs = new MvnFileSystem(rootName, fileSystemOptions); addFileSystem(key, fs); } return fs.resolveFile(url.getPath()); } catch (final MalformedURLException e) { throw new FileSystemException("vfs.provider.url/badly-formed-uri.error", uri, e); } }
protected TarFileSystem(final FileName rootName, final FileObject parentLayer, final FileSystemOptions fileSystemOptions) throws FileSystemException { super(rootName, parentLayer, fileSystemOptions); // Make a local copy of the file file = parentLayer.getFileSystem().replicateFile(parentLayer, Selectors.SELECT_SELF); // Open the Tar file if (!file.exists()) { // Don't need to do anything tarFile = null; return; } // tarFile = createTarFile(this.file); }
io.info("Readable: {}", file.isReadable()); io.info("Writeable: {}", file.isWriteable()); io.info("Root path: {}", file.getFileSystem().getRoot().getName().getPath());
/** * create the filecontentinfo implementation */ protected FileContentInfoFactory getFileContentInfoFactory() { return getFileSystem().getFileSystemManager().getFileContentInfoFactory(); }
/** * Creates a layered file system. */ public FileObject createFileSystem(final String scheme, final FileObject file) throws FileSystemException { final FileProvider provider = (FileProvider) providers.get(scheme); if (provider == null) { throw new FileSystemException("vfs.impl/unknown-provider.error", new Object[] { scheme, file }); } return provider.createFileSystem(scheme, file, file.getFileSystem() .getFileSystemOptions()); }
file.getFileSystem().addListener(file, this.listener);
public XStoreRecord resolveRecord(final String path) { assert path != null; final XStoreImpl prev = XStoreHolder.get(); XStoreHolder.set(this); try { FileObject file = getFileSystem().resolveFile(path); return new XStoreRecordImpl(this, file); } catch (FileSystemException e) { throw new XStoreException(e); } finally { if (prev != null) { XStoreHolder.set(prev); } } }