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; } }
protected SftpFileObject(final FileName name, final SftpFileSystem fileSystem) throws FileSystemException { super(name, fileSystem); this.fileSystem = fileSystem; relPath = UriParser.decode(fileSystem.getRootName().getRelativeName( name)); }
private GroupCommand createGroupCommand(final FileObject file) throws FileSystemException { assert file != null; log.trace("Creating command for group: {}", file); GroupCommand command = container.getBean(GroupCommand.class); String path = fileSystemAccess.dereference(commandsRoot).getName().getRelativeName(file.getName()); if (".".equals(path)) { path = "/"; } command.setPath(path); return command; } }
/** * Creates a file object. This method is called only if the requested * file is not cached. */ protected FileObject createFile(final FileName 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 = (FileObject) 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); }
public boolean includeFile( FileSelectInfo fileSelectInfo ) throws Exception { FileObject fileObject = fileSelectInfo.getFile(); FileName name = fileObject.getName(); if ( fileType != null && fileObject.getType() != fileType ) { return false; } String relativePath = root.getRelativeName( name ); return matches( relativePath ); }
relName = srcDirName.getRelativeName(rootName); if (srcDirName == null || !srcDirIsBase) relName = rootName.getRelativeName(srcFile.getName()); relName = srcDirName.getRelativeName(srcFile.getName());
String relativeName = from.getName().getRelativeName( f.getName() );
final String relPath = file.getName().getRelativeName(srcFile.getName()); final FileObject destFile = resolveFile(relPath, NameScope.DESCENDENT_OR_SELF);