protected void implCloseChannel()

in src/main/java/org/apache/sling/commons/jcr/file/internal/JcrFileChannel.java [198:211]


    protected void implCloseChannel() throws IOException {
        logger.info("implCloseChannel");
        fileChannel.close();
        try (final InputStream inputStream = Files.newInputStream(file, READ, DELETE_ON_CLOSE)) {
            final Session session = node.getSession();
            final ValueFactory valueFactory = session.getValueFactory();
            final Binary binary = valueFactory.createBinary(inputStream);
            setBinary(binary);
            session.save();
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            throw new IOException(e);
        }
    }