@SuppressFBWarnings(justification = "null check of file on entry point of method", value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
    public Response andBinaryFile(Path file) {
        Objects.requireNonNull(file, Required.FILE.toString());

        try (InputStream inputStream = Files.newInputStream(file)) {
            this.binaryFileName = file.getFileName().toString();
            this.binaryContent = IOUtils.toByteArray(inputStream);
            this.binary = true;
            this.rendered = false;
        } catch (final IOException e) {
            LOG.error("Failed to handle binary file", e);
        }

        return this;
    }
@ SuppressFBWarnings ( justification = "null check of file on entry point of method" , value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" ) public Response andBinaryFile ( Path file ) { Objects . requireNonNull ( file , Required . FILE . toString ( ) ) ; try ( InputStream inputStream = Files . newInputStream ( file ) ) { this . binaryFileName = file . getFileName ( ) . toString ( ) ; this . binaryContent = IOUtils . toByteArray ( inputStream ) ; this . binary = true ; this . rendered = false ; } catch ( final IOException e ) { LOG . error ( "Failed to handle binary file" , e ) ; } return this ; }
Sends a binary file to the client skipping rendering

@param file The file to send
@return A response object {@link io.mangoo.routing.Response}