#ifndef HTTPRESPONSE_H
#define HTTPRESPONSE_H

/*
 * @(#)HTTPResponse.h
 *
 * This file is part of webCDwriter - Network CD Writing.
 *
 * Copyright (C) 2002 Jörg P. M. Haeger
 *
 * webCDwriter is free software. See CDWserver.cpp for details.
 */

#include "FileInputStream.h"
#include "String.h"

class HTTPResponse {
	int statusCode;
	String reasonPhrase;
	// Response-Header
	String location;
	// Entity Header Fields
	String contentLength;
	String contentType;
	String entityBody;
	FileInputStream entityStream;
public:
	HTTPResponse();
	HTTPResponse(HTTPResponse *response);
	~HTTPResponse();
	static HTTPResponse *movedPermanently(String &location);
	static HTTPResponse *notFound();
	static HTTPResponse *notImplemented();
	void setEntity(File &file);
	void setEntity(String &body, String &type);
	void setLocation(String &aLocation);
	void setStatusCode(int code);
	void write(class PrintWriter &writer);
	void writeHead(class PrintWriter &writer);
private:
	String *getErrorHTML();
};

#endif
