/** * Attaches a child to this file. The parent IsoFileSystem calls this method when building the file index. */ void attachChild(final FileName childName) { this.children.add(childName.getBaseName()); }
public static File asFile( FileObject fileObject ) { return new File( fileObject.getName().getPath() ); } }
/** * Determines if another file name is an ancestor of this file name. */ public boolean isAncestor(final FileName ancestor) { if (!ancestor.getRootURI().equals(getRootURI())) { return false; } return checkName(ancestor.getPath(), getPath(), NameScope.DESCENDENT); }
io.info("BaseName: {}", file.getName().getBaseName()); io.info("Extension: {}", file.getName().getExtension()); io.info("Path: {}", file.getName().getPath()); io.info("Scheme: {}", file.getName().getScheme()); io.info("URI: {}", file.getName().getURI()); io.info("Root URI: {}", file.getName().getRootURI()); io.info("Parent: {}", file.getName().getParent()); io.info("Type: {}", file.getType()); io.info("Exists: {}", file.exists()); io.info("Readable: {}", file.isReadable()); io.info("Writeable: {}", file.isWriteable()); io.info("Root path: {}", file.getFileSystem().getRoot().getName().getPath());
FileObject localDestFile = fsManager.resolveFile(destinationDirectory.getName().getPath() + "/" + fileObject.getName().getBaseName()); localDestFile.createFile(); localDestFile.copyFrom(fileObject, Selectors.SELECT_ALL); incrementFileHit(fileObject.getName().getBaseName()); //TODO Don't know if this file would exist String contentsRow = fileObject.getName().getBaseName(); if (fileParameters.length() > 0) { System.out.println("There is no file named " + fileObject.getName().getBaseName() + " while making " + destinationDirectory.getName().getBaseName()); } catch (IOException e) { e.printStackTrace();
if (base != null && VFS.isUriStyle() && base.getType() == FileType.FILE) realBase = base.getParent(); buffer.insert(0, realBase.getPath()); .checkName(realBase.getPath(), resolvedPath, scope)) String scheme = realBase.getScheme(); String fullPath = realBase.getRootURI() + resolvedPath; final FileProvider provider = (FileProvider) providers.get(scheme); if (provider != null)
/** * Attaches this file object to its file resource. */ protected void doAttach() throws Exception { if (file == null) { LayeredFileName layeredFileName = (LayeredFileName) getName(); String fileName = layeredFileName.getOuterName().getRootURI() + layeredFileName.getOuterName().getPathDecoded(); FileObject outer = getFileSystem().resolveFile(fileName); if (outer instanceof TruezipFileObject) { fileName = layeredFileName.getOuterName().getPathDecoded() + getName().getPathDecoded(); file = new File(fileName, ArchiveDetector.ALL); } else { fileObject = outer; DefaultFileSystemManager dfsMgr = (DefaultFileSystemManager) VFS.getManager(); file = new File(dfsMgr.getTemporaryFileStore().allocateFile(getName().getBaseName())); } } }
if (srcDirName == null || !srcDirIsBase) relName = rootName.getBaseName(); relName = srcDirName.getRelativeName(rootName); if (srcDirName == null || !srcDirIsBase) relName = rootName.getRelativeName(srcFile.getName()); relName = srcDirName.getRelativeName(srcFile.getName());
protected void appendRootUri(StringBuffer buffer, boolean addPassword) { buffer.append(getScheme()); buffer.append(":"); buffer.append(getOuterName().getURI()); buffer.append("!"); } }
protected FtpFileObject(final FileName name, final FtpFileSystem fileSystem, final FileName rootName) throws FileSystemException { super(name, fileSystem); ftpFs = fileSystem; String relPath = UriParser.decode(rootName.getRelativeName(name)); if (".".equals(relPath)) { // do not use the "." as path against the ftp-server // e.g. the uu.net ftp-server do a recursive listing then // this.relPath = UriParser.decode(rootName.getPath()); // this.relPath = "."; this.relPath = null; } else { this.relPath = relPath; } }
public void registerData(final FileName name, final MetaData data) { assert name != null; assert data != null; log.trace("Registering data: {}", name); if (name.getDepth() > 0) { MetaData parent = getParentData(name); if (parent != null) { if (!parent.hasChild(data)) { parent.addChild(data); } } else { log.warn("Depth is > 0, but parent name is null for node: " + name); } } getNodes().put(name, data); eventPublisher.publish(new MetaDataRegisteredEvent(name, data)); }
io.info("BaseName: {}", file.getName().getBaseName()); io.info("Extension: {}", file.getName().getExtension()); io.info("Path: {}", file.getName().getPath()); io.info("Scheme: {}", file.getName().getScheme()); io.info("URI: {}", file.getName().getURI()); io.info("Root URI: {}", file.getName().getRootURI()); io.info("Parent: {}", file.getName().getParent()); io.info("Type: {}", file.getType()); io.info("Exists: {}", file.exists()); io.info("Readable: {}", file.isReadable()); io.info("Writeable: {}", file.isWriteable()); io.info("Root path: {}", file.getFileSystem().getRoot().getName().getPath());
file.setName( fileObjects[i].getName().getBaseName() ); file.setPath( fileObjects[i].getName().getPath() ); file.setFile( fileObjects[i].getType().equals( FileType.FILE ) ); file.setLastModificationDate( new Date( fileObjects[i].getContent().getLastModifiedTime() ) );
if ( f.getName().getBaseName().equals( "" ) ) String relativeName = from.getName().getRelativeName( f.getName() );
/** * Does a reverse lookup to find the FileObject when we only have the * URL. */ private FileObject lookupFileObject(final String name) { final Iterator it = resources.iterator(); while (it.hasNext()) { final FileObject object = (FileObject) it.next(); if (name.equals(object.getName().getURI())) { return object; } } return null; }
/** * Determines if another file name is a descendent of this file name. */ public boolean isDescendent(final FileName descendent, final NameScope scope) { if (!descendent.getRootURI().equals(getRootURI())) { return false; } return checkName(getPath(), descendent.getPath(), scope); }
protected SftpFileObject(final FileName name, final SftpFileSystem fileSystem) throws FileSystemException { super(name, fileSystem); this.fileSystem = fileSystem; relPath = UriParser.decode(fileSystem.getRootName().getRelativeName( name)); }
public void registerData(final FileName name, final MetaData data) { assert name != null; assert data != null; log.trace("Registering data: {}", name); if (name.getDepth() > 0) { MetaData parent = getParentData(name); if (parent != null) { if (!parent.hasChild(data)) { parent.addChild(data); } } else { log.warn("Depth is > 0, but parent name is null for node: " + name); } } getNodes().put(name, data); eventPublisher.publish(new MetaDataRegisteredEvent(name, data)); }
/** * Attaches a child */ protected void attachChild(FileName childName) { children.add(childName.getBaseName()); }