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

com.yahoo.restapi.StringResponse Maven / Gradle / Ivy

// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.restapi;

import com.yahoo.container.jdisc.HttpResponse;

import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;

/**
 * @author bratseth
 */
public class StringResponse extends HttpResponse {

    private final String message;
    
    public StringResponse(String message) {
        super(200);
        this.message = message;
    }

    @Override
    public void render(OutputStream stream) throws IOException {
        stream.write(message.getBytes(StandardCharsets.UTF_8));
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy