@Override public InputSocket<? extends Entry> input( BitField<FsAccessOption> options, FsNodeName name) { return controller.input(options, name); }
@Override public final InputSocket<? extends Entry> input(BitField<FsAccessOption> options, FsNodeName name) { return controller.input(map(options), name); }
/** * Called to prepare reading an archive file artifact of this driver from * {@code name} in {@code controller} using {@code options}. * <p> * This method is overridable to enable modifying the given options * before forwarding the call to the given controller. * The implementation in the class {@link FsArchiveDriver} simply forwards * the call to the given controller with the given options unaltered. * * @param options the options for accessing the file system node. * @param controller the controller to use for reading an artifact of this * driver. * @param name the node name. * @return A source for reading an artifact of this driver. * @see #newInput(FsModel, BitField, FsController, FsNodeName) */ protected FsInputSocketSource source( BitField<FsAccessOption> options, FsController controller, FsNodeName name) { return new FsInputSocketSource(options, controller.input(options, name)); }
InputSocket<?> input( TPath path, BitField<FsAccessOption> options) { return getController().input(options, path.getNodeName()); }
InputStream newInputStream(TPath path, OpenOption... options) throws IOException { return getController() .input(path.inputOptions(options), path.getNodeName()) .stream(null); }
/** * Returns an input socket for the given file. * * @param file the file to read. * @param options the options for accessing the file. * @return An input socket for the given file. */ static InputSocket<?> input( final BitField<FsAccessOption> options, final File file) { if (file instanceof TFile) { final TFile tfile= (TFile) file; final TFile archive = tfile.getInnerArchive(); if (null != archive) return archive .getController() .input(options, tfile.getNodeName()); } final FsNodePath path = new FsNodePath(file); return TConfig .current() .getManager() .controller(detector(file), path.getMountPoint()) .input(options, path.getNodeName()); }
SeekableByteChannel newByteChannel( final TPath path, final Set<? extends OpenOption> options, final FileAttribute<?>... attrs) throws IOException { final FsNodeName name = path.getNodeName(); final FsController controller = getController(); if (options.isEmpty() || options.contains(StandardOpenOption.READ)) { final BitField<FsAccessOption> o = path.inputOptions(options).set(CACHE); return controller .input(o, name) .channel(null); } else { final BitField<FsAccessOption> o = path.outputOptions(options).set(CACHE); try { return controller .output(o, name, null) .channel(null); } catch (final IOException ex) { // TODO: Filter FileAlreadyExistsException. if (o.get(EXCLUSIVE) && null != controller.node(o, name)) throw (IOException) new FileAlreadyExistsException(path.toString()) .initCause(ex); throw ex; } } }