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

org.archive.format.http.HttpResponseMessage Maven / Gradle / Ivy

There is a newer version: 1.1.9
Show newest version
package org.archive.format.http;

public class HttpResponseMessage extends HttpMessage implements HttpResponseMessageObserver {
	private int status = 0;
	private String reason = null;
	
	public HttpResponseMessage(){}

	public HttpResponseMessage(int version, int status, String reason) {
		this.version = version;
		this.status = status;
		this.reason = reason;
	}

	public int getStatus() {
		return status;
	}
	
	public String getReason() {
		return reason;
	}
	public String toString() {
		return String.format("%s %d %s%s", getVersionString(), status, reason, CRLF);
	}
	public String toDebugString() {
		return String.format("Message(%d):(%s) (%d) (%s)\n",
				reason.length(),getVersionString(),status,reason,CRLF);
	}

	public void messageParsed(int version, int status, String reason, int bytes) {
		this.version = version;
		this.status = status;
		this.reason = reason;
		this.bytes = bytes;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy