All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.blade.mvc.http.StreamBody Maven / Gradle / Ivy

There is a newer version: 2.0.15.RELEASE
Show newest version
package com.blade.mvc.http;

import java.io.InputStream;

public class StreamBody implements Body {

    private final InputStream content;
    private final String      fileName;

    public StreamBody(String fileName, InputStream content) {
        this.fileName = fileName;
        this.content = content;
    }

    public StreamBody(final InputStream content) {
        this.fileName = null;
        this.content = content;
    }

    public InputStream content() {
        return content;
    }

    public String fileName() {
        return this.fileName;
    }

    @Override
    public  T write(BodyWriter writer) {
        return writer.onStream(this);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy