HttpController(final HttpDriver driver, final FsModel model) { super(model); if (null != model.getParent()) throw new IllegalArgumentException(); assert null != driver; this.driver = driver; }
@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 FsController newController( final FsManager manager, final FsModel model, final @CheckForNull FsController parent) { assert null == parent; assert null == model.getParent(); return new FileController(model); } }
protected FsDecoratingModel(final FsModel model) { super(model.getMountPoint(), model.getParent()); this.model = model; }
@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); }
/** * {@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 String getMountPointOfParent() { final FsModel parent = model.getParent(); return null != parent ? parent.getMountPoint().toString() : null; }
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); }