class BoxDownloadCustomizer implements ComponentProxyCustomizer {

    private void afterProducer(Exchange exchange) {
        BoxFile file = new BoxFile();
        Message in = exchange.getIn();
        file.setId(fileId);
        ByteArrayOutputStream output = in.getBody(ByteArrayOutputStream.class);
        try {
            file.setContent(new String(output.toByteArray(), encoding));
        } catch (UnsupportedEncodingException e) {
            LOG.error("Failed to convert file content to String. Invalid file encoding: {}", encoding);
        }
        file.setSize(output.size());
        in.setBody(file);
    }

}