OutputSocket<?> getOutputSocket(TPath path, BitField<FsOutputOption> options, @CheckForNull Entry template) { return getController() .getOutputSocket(path.getEntryName(), options, template); }
/** * Sets {@link FsOutputOption#STORE} in {@code options} before * forwarding the call to {@code controller}. */ @Override public final OptionOutputSocket getOutputSocket( final FsController<?> controller, final FsEntryName name, BitField<FsOutputOption> options, final @CheckForNull Entry template) { // Leave FsOutputOption.COMPRESS untouched - the driver shall be given // opportunity to apply its own preferences to sort out such a conflict. options = options.set(STORE); // The RAES file format cannot support GROWing. options = options.clear(GROW); return new OptionOutputSocket( controller.getOutputSocket(name, options, template), options); }
OutputStream newOutputStream(TPath path, OpenOption... options) throws IOException { return getController() .getOutputSocket( path.getEntryName(), path.mapOutput(options), null) .newOutputStream(); }
options = options.set(APPEND).clear(CACHE); return new OptionOutputSocket( controller.getOutputSocket(name, options, template), options);
if (null != archive) return archive .getController() .getOutputSocket( tdst.getInnerFsEntryName(), options, template); .getFsManager() .getController( path.getMountPoint(), getDetector(dst)) .getOutputSocket( path.getEntryName(), options.clear(CREATE_PARENTS), template);
SeekableByteChannel newByteChannel( final TPath path, final Set<? extends OpenOption> options, final FileAttribute<?>... attrs) throws IOException { final FsEntryName name = path.getEntryName(); final FsController<?> controller = getController(); if (options.isEmpty() || options.contains(StandardOpenOption.READ)) { final BitField<FsInputOption> o = path.mapInput(options).set(FsInputOption.CACHE); return controller .getInputSocket(name, o) .newSeekableByteChannel(); } else { final BitField<FsOutputOption> o = path.mapOutput(options).set(FsOutputOption.CACHE); try { return controller .getOutputSocket(name, o, null) .newSeekableByteChannel(); } catch (final IOException ex) { if (o.get(EXCLUSIVE) && null != controller.getEntry(name)) throw (IOException) new FileAlreadyExistsException(path.toString()) .initCause(ex); throw ex; } } }
OutputSocket<?> dstSocket = manager .getController( dstPath.getMountPoint(), driver) .getOutputSocket( dstPath.getEntryName(), BitField.of(FsOutputOption.CREATE_PARENTS, FsOutputOption.EXCLUSIVE),