/** {@inheritDoc} */ @Override public void force(boolean withMetadata) throws IOException { ch.force(withMetadata); }
private synchronized void doFlush(Handler<AsyncResult<Void>> handler) { checkClosed(); context.executeBlockingInternal((Future<Void> fut) -> { try { ch.force(false); fut.complete(); } catch (IOException e) { throw new FileSystemException(e); } }, handler); }
private synchronized void doFlush(Handler<AsyncResult<Void>> handler) { checkClosed(); context.executeBlockingInternal((Future<Void> fut) -> { try { ch.force(false); fut.complete(); } catch (IOException e) { throw new FileSystemException(e); } }, handler); }
public void force(boolean metaData) throws IOException { ac.force(metaData); }
public Void action() throws Exception { ch.force(false); return null; } }.run();
/** {@inheritDoc} */ @Override public void force(boolean withMetadata) throws IOException { ch.force(withMetadata); }
@Override public void force(final boolean metaData) throws IOException { chan.force(metaData); }
public void force(boolean metaData) throws IOException { ac.force(metaData); }
private void closeForReal() { _log.debug("closing file " + file.getAbsolutePath()); try { ch.force(true); } catch (Exception x) { _log.error("unable to force update file " + file.getAbsolutePath(), x); } try { ch.close(); } catch (Exception x) { _log.warn("unable to close file " + file.getAbsolutePath(), x); } }
/** * Closes the channel. Note that no write will be possible after calling this method. * * @return True if channel was closed, false if the channel was already closed. * * @throws IOException * If {@link IOException} happens during closing. */ public boolean closeChannel() throws IOException { openCloseLock.lock(); try { if (this.isOpened()) { fileChannel.force(true); fileChannel.close(); if (log.isDebugEnabled()) { log.info("Channel closed for path " + path + ". Next write position is " + nextWritingPosition.get() + "."); } return true; } else { if (log.isDebugEnabled()) { log.info("Tried to close already closed channel for path " + path + "."); } return false; } } finally { openCloseLock.unlock(); } }
this.ch.write(another, this.pos, null, new MyHandler(bytesToWrite, handler)); try { this.ch.force(true);
@Override public void stopSending() { if (destination.isOpen()) { try { // The lock will not be released, as you don't release a closed file destination.lock(); destination.force(true); destination.close(); } catch (IOException e) { logger.error("Failed to close {}: {}", fileName, Helpers.resolveThrowableException(e)); logger.catching(Level.DEBUG, e); } } super.stopSending(); }
final AsynchronousFileChannel ch = AsynchronousFileChannel.open(f.toPath(), StandardOpenOption.WRITE); ch.force(true);
final AsynchronousFileChannel ch = AsynchronousFileChannel.open(f.toPath(), StandardOpenOption.WRITE); ch.force(true);