private @Nullable FsScheme getScheme() { if (this != innerArchive) return null; final FsController<?> controller = this.controller; if (null != controller) return controller.getModel().getMountPoint().getScheme(); return detector.getScheme(file.getPath()); }
FsMountPoint getMountPoint() { return getController().getModel().getMountPoint(); }
/** * If this file refers to an archive file, its archive driver is asked to * return an icon to be displayed for this file. * Otherwise, null is returned. * * @return An icon or {@code null}. * @deprecated GUI features will be removed from this class in TrueZIP 8. */ @Deprecated public @CheckForNull Icon getOpenIcon() { return isArchive() ? ((FsArchiveDriver<?>) getDriver(getScheme())) .getOpenIcon(getController().getModel()) : null; }
/** * If this file refers to an archive file, its archive driver is asked to * return an icon to be displayed for this file. * Otherwise, null is returned. * * @return An icon or {@code null}. * @deprecated GUI features will be removed from this class in TrueZIP 8. */ @Deprecated public @CheckForNull Icon getClosedIcon() { return isArchive() ? ((FsArchiveDriver<?>) getDriver(getScheme())) .getClosedIcon(getController().getModel()) : null; }
/** * Returns a mount point for the given (virtual) directory {@code tree}. * If {@code tree} refers to a (prospective) archive file, then its mount * point gets returned. * Otherwise, the path of the file object is used to create a new mount * point. * Note that making up an artificial mount point like this will only work * with the {@link FsFilteringManager}! * * @param tree a file or directory in the (virtual) file system space. * @return A mount point for the given (virtual) directory tree. */ static FsMountPoint mountPoint(final TFile tree) { if (tree.isArchive()) { return tree.getController().getModel().getMountPoint(); // fast path //return tree.toFsPath().getMountPoint(); // slow path } try { return new FsMountPoint(new URI(tree.getFile().toURI() + "/"), CANONICALIZE); } catch (final URISyntaxException ex) { throw new AssertionError(ex); } }
/** * Constructs a new mock controller. * * @param model The file system model. * @param parent The parent file system controller. * @param config The mocking configuration. */ public MockController( final FsModel model, final @CheckForNull FsController<?> parent, final @CheckForNull TestConfig config) { assert null == model.getParent() ? null == parent : model.getParent().equals(parent.getModel()); this.model = model; this.parent = parent; this.config = null != config ? config : TestConfig.get(); }
? new FsPath( file) : new FsPath( enclArchive .getController() .getModel() .getMountPoint(), enclEntryName));
assertThat(filter.getSize(), is(params[2].length)); for (final FsController<?> controller : filter) assertTrue(set.contains(controller.getModel().getMountPoint()));
final FsMountPoint mountPoint = FsMountPoint.create(URI.create(param)); assertThat(i.next().getModel().getMountPoint(), equalTo(mountPoint));