@Override public String getRelativeName(FileName name) throws FileSystemException { return fileName.getRelativeName(name); }
protected FtpFileObject(final AbstractFileName name, final FtpFileSystem fileSystem, final FileName rootName) throws FileSystemException { super(name, fileSystem); final 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 FtpFileObject(final AbstractFileName name, final FtpFileSystem fileSystem, final FileName rootName) throws FileSystemException { super(name, fileSystem); final 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 FtpFileObject(final AbstractFileName name, final FtpFileSystem fileSystem, final FileName rootName) throws FileSystemException { super(name, fileSystem); final 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 FtpFileObject(final AbstractFileName name, final FtpFileSystem fileSystem, final FileName rootName) throws FileSystemException { super(name, fileSystem); final 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; } }
@Override public String getID(int index) { try { return base.getName().getRelativeName(files[index].getName()); } catch (final FileSystemException e) { throw new RuntimeException(e); } }
protected SftpFileObject(final AbstractFileName name, final SftpFileSystem fileSystem) throws FileSystemException { super(name, fileSystem); relPath = UriParser.decode(fileSystem.getRootName().getRelativeName( name)); }
protected SftpFileObject(final AbstractFileName name, final SftpFileSystem fileSystem) throws FileSystemException { super(name, fileSystem); relPath = UriParser.decode(fileSystem.getRootName().getRelativeName(name)); }
protected SftpFileObject(final AbstractFileName name, final SftpFileSystem fileSystem) throws FileSystemException { super(name, fileSystem); relPath = UriParser.decode(fileSystem.getRootName().getRelativeName(name)); }
protected SftpFileObject(final AbstractFileName name, final SftpFileSystem fileSystem) throws FileSystemException { super(name, fileSystem); relPath = UriParser.decode(fileSystem.getRootName().getRelativeName(name)); }
/** * 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 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 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 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); }
protected Record(FileObject image) throws FileSystemException, IOException { final FileSystemManager fsManager = VFS.getManager(); final FileObject imagesBase = fsManager.resolveFile(downloadAndGetImagePath()); final FileObject annotationsBase = fsManager.resolveFile(downloadAndGetAnnotationPath()); // get the id id = imagesBase.getName().getRelativeName(image.getName()); // the class objectClass = image.getParent().getName().getBaseName(); // find the annotation file final String annotationFileName = id.replace("image_", "annotation_").replace(".jpg", ".mat"); final FileObject annotationFile = annotationsBase.resolveFile(annotationFileName); parseAnnotations(annotationFile); }
protected Record(FileObject image) throws FileSystemException, IOException { final FileSystemManager fsManager = VFS.getManager(); final FileObject imagesBase = fsManager.resolveFile(downloadAndGetImagePath()); final FileObject annotationsBase = fsManager.resolveFile(downloadAndGetAnnotationPath()); // get the id id = imagesBase.getName().getRelativeName(image.getName()); // the class objectClass = image.getParent().getName().getBaseName(); // find the annotation file final String annotationFileName = id.replace("image_", "annotation_").replace(".jpg", ".mat"); final FileObject annotationFile = annotationsBase.resolveFile(annotationFileName); parseAnnotations(annotationFile); }
/** * Checks that a file name converts to an expected relative path */ private void testRelName(final FileName baseName, final String relPath) throws Exception { final FileName expectedName = getManager().resolveName(baseName, relPath); // Convert to relative path, and check final String actualRelPath = baseName.getRelativeName(expectedName); assertEquals(relPath, actualRelPath); } }
/** * Checks that a file name converts to an expected relative path */ private void testRelName(final FileName baseName, final String relPath) throws Exception { final FileName expectedName = getManager().resolveName(baseName, relPath); // Convert to relative path, and check final String actualRelPath = baseName.getRelativeName(expectedName); assertEquals(relPath, actualRelPath); } }
/** * Checks that a file name converts to an expected relative path */ private void testRelName(final FileName baseName, final String relPath) throws Exception { final FileName expectedName = getManager().resolveName(baseName, relPath); // Convert to relative path, and check final String actualRelPath = baseName.getRelativeName(expectedName); assertEquals(relPath, actualRelPath); } }
/** * Populate a node. * @param root Relative root directory. * @param file The file object. * @return The node data structure which presents the file. * @throws FileSystemException */ protected JsTreeNodeData populateTreeNodeData(FileObject root, FileObject file) throws FileSystemException { boolean noChild = true; FileType type = file.getType(); if (type.equals(FileType.FOLDER) || type.equals(FileType.FILE_OR_FOLDER)){ noChild = file.getChildren().length == 0; } String relativePath = root.getName().getRelativeName(file.getName()); return populateTreeNodeData(file, noChild, relativePath); } /**