/** * Returns the mount point of this (virtual) file system as * defined by the {@linkplain #getModel() model}. * * @return The mount point of this (virtual) file system as * defined by the {@linkplain #getModel() model}. */ public final FsMountPoint getMountPoint() { return model.getMountPoint(); }
protected FsDecoratingModel(final FsModel model) { super(model.getMountPoint(), model.getParent()); this.model = model; }
/** * Returns the {@code mounted} property of the * {@linkplain #getModel() file system model}. * * @return the {@code mounted} property of the * {@linkplain #getModel() file system model}. */ public final boolean isMounted() { return model.isMounted(); }
HttpController(final HttpDriver driver, final FsModel model) { super(model); if (null != model.getParent()) throw new IllegalArgumentException(); assert null != driver; this.driver = driver; }
@Override public void setMounted(final boolean mounted) { if (model.isMounted() != mounted) { model.setMounted(mounted); if (mounted) mediator.register(objectName, newView()); else mediator.deregister(objectName); } } }
/** * Sets the {@code mounted} property of the * {@linkplain #getModel() file system model}. * * @param mounted the {@code mounted} property of the * {@linkplain #getModel() file system model}. */ protected final void setMounted(boolean mounted) { model.setMounted(mounted); }
@Override public FsController newController( final FsManager manager, final FsModel model, final @CheckForNull FsController parent) { assert null == parent; assert null == model.getParent(); return new HttpController(this, model); } }
@Override public void setMounted(boolean touched) { model.setMounted(touched); }
protected FsAbstractModel( final FsMountPoint mountPoint, final @CheckForNull FsModel parent) { if (!Objects.equals(mountPoint.getParent(), (null == parent ? null : parent.getMountPoint()))) throw new IllegalArgumentException("Parent/Member mismatch!"); this.mountPoint = mountPoint; this.parent = parent; }
@Override public String getMountPointOfParent() { final FsModel parent = model.getParent(); return null != parent ? parent.getMountPoint().toString() : null; }
@Override public FsController newController( final FsManager manager, final FsModel model, final @CheckForNull FsController parent) { assert null == parent; assert null == model.getParent(); return new FileController(model); } }
@Override public boolean isMounted() { return model.isMounted(); }
@Override public boolean accept(FsModel model) { return filter.accept(model.getMountPoint()); } }
@Override public final FsController newController( final FsManager context, final FsModel model, final @CheckForNull FsController parent) throws ServiceConfigurationError { assert null == parent ? null == model.getParent() : parent.getModel().equals(model.getParent()); return driver(model.getMountPoint()).newController(context, model, parent); }
@Override public boolean isMounted() { return model.isMounted(); }
@Override public String getMountPoint() { return model.getMountPoint().toString(); }
FileController(final FsModel model) { super(model); if (null != model.getParent()) throw new IllegalArgumentException(); URI uri = model.getMountPoint().getUri(); if ('\\' == separatorChar && null != uri.getRawAuthority()) { try { // Postfix: Move Windows UNC host from authority to path // component because the File class can't deal with this. // Note that the authority parameter must not be null and that // you cannot use the UriBuilder class - using either of these // would result in the authority property of the new URI object // being equal to the original value again. // Note that the use of the buggy URI constructor is authorized // for this case! // See http://java.net/jira/browse/TRUEZIP-288 . uri = new URI( uri.getScheme(), "", TWO_SEPARATORS + uri.getAuthority() + uri.getPath(), uri.getQuery(), uri.getFragment()); } catch (URISyntaxException ex) { throw new AssertionError(ex); } } this.target = Paths.get(uri); }
/** * {@inheritDoc} * <p> * The implementation in the class {@link FsArchiveDriver} forwards the * call to the given file system manager. */ @Override public final FsController newController( FsManager context, FsModel model, @Nonnull FsController parent) { assert parent.getModel().equals(model.getParent()); return context.newController(this, model, parent); }
@Override public boolean accept(FsController controller) { return controller.getModel().isMounted(); } }