package net.zephyrizing.http_server;

import java.nio.file.Path;
import java.util.stream.Stream;

public class HttpResponse {
    private Path content;

    public static HttpResponse responseFor(HttpRequest request) {
        return new HttpResponse(request.protocolVersion());
    }

    private String protocolVersion;

    public HttpResponse(String protocolVersion) {
        this.protocolVersion = protocolVersion;
    }

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

    public void setContent(Path file) {
        content = file;
    }

    public String getStatus() {
        return String.format("HTTP/%s %d %s",
                             protocolVersion(), 200, "OK");
    }

    public Stream<String> getStatusStream() {
        return emptyStringStream()
            .add(getStatus())
            .build();
    }

    public Stream<String> getHeaderStream() {
        return emptyStringStream();
    }

    public Stream<String> getDataStream() {
        return emptyStringStream();
    }

    private static Stream.Builder<String> emptyStringStream() {
        return Stream.builder();
    }
}

@@ -797,16 +797,23 @@
 ngStream
+Builder
 ()%0A     
@@ -936,32 +936,47 @@
 mptyStringStream
+Builder().build
 ();%0A    %7D%0A%0A    p
@@ -1046,16 +1046,31 @@
 ngStream
+Builder().build
 ();%0A    
@@ -1127,24 +1127,31 @@
 StringStream
+Builder
 () %7B%0A       

Rename stream helper method in HttpResponse