trunk contents moved to root

This commit is contained in:
Jindra Petřík
2014-05-10 20:50:57 +02:00
parent 1b851e66a8
commit 199a4d0c2b
2296 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
package com.jpexs.proxy;
class HttpError
{
StringBuffer content = null;
Reply reply = null;
HttpError(int code, String message)
{
String error;
switch (code)
{
case 400:
error = "Bad Request";
break;
case 403:
error = "Forbidden";
break;
case 404:
error = "Not found";
break;
case 503:
error = "Service Unavailable";
break;
default:
error = "Error";
break;
}
reply = new Reply();
reply.statusLine = "HTTP/1.0 " + code + " " + error;
reply.setHeaderField("Content-type", "text/html");
reply.setHeaderField("Server", ProxyConfig.appName+"/" +ProxyConfig.appVersion);
content = new StringBuffer();
content.append(message);
}
Reply getReply()
{
return reply;
}
String getContent()
{
if (content == null)
{
return null;
}
return content.toString();
}
public String toString()
{
StringBuffer buf = new StringBuffer();
if (reply != null)
{
buf.append(reply.toString());
}
if (content != null)
{
buf.append(content.toString());
}
return buf.toString();
}
}