Package jetbrains.buildServer.util
Class SimpleHttpServerBase
- java.lang.Object
-
- jetbrains.buildServer.util.SimpleHttpServerBase
-
- Direct Known Subclasses:
SimpleHttpServer
public abstract class SimpleHttpServerBase extends Object
- Author:
- Eugene Petrenko Created: 27.07.2009 16:25:49
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SimpleHttpServerBase.Response
-
Field Summary
Fields Modifier and Type Field Description protected Pattern
requestParser
static String
STATUS_LINE_200
static String
STATUS_LINE_201
static String
STATUS_LINE_301
static String
STATUS_LINE_304
static String
STATUS_LINE_401
static String
STATUS_LINE_404
static String
STATUS_LINE_500
-
Constructor Summary
Constructors Constructor Description SimpleHttpServerBase()
-
Method Summary
-
-
-
Field Detail
-
STATUS_LINE_200
public static final String STATUS_LINE_200
- See Also:
- Constant Field Values
-
STATUS_LINE_201
public static final String STATUS_LINE_201
- See Also:
- Constant Field Values
-
STATUS_LINE_301
public static final String STATUS_LINE_301
- See Also:
- Constant Field Values
-
STATUS_LINE_304
public static final String STATUS_LINE_304
- See Also:
- Constant Field Values
-
STATUS_LINE_401
public static final String STATUS_LINE_401
- See Also:
- Constant Field Values
-
STATUS_LINE_404
public static final String STATUS_LINE_404
- See Also:
- Constant Field Values
-
STATUS_LINE_500
public static final String STATUS_LINE_500
- See Also:
- Constant Field Values
-
requestParser
protected Pattern requestParser
-
-
Method Detail
-
getFileResponse
protected static SimpleHttpServerBase.Response getFileResponse(@NotNull File file, @NotNull List<String> headers)
-
getPort
public int getPort()
-
start
public void start() throws IOException
- Throws:
IOException
-
processRequest
protected void processRequest(Socket connection)
-
postProcessSocketData
protected void postProcessSocketData(String httpHeader, @NotNull InputStream is) throws IOException
read all stream and ignore the result otherwise it breaks the connection- Parameters:
httpHeader
- headersis
- body- Throws:
IOException
-
stop
public void stop()
-
setWaitAfterAccept
public void setWaitAfterAccept(int seconds)
-
failNRequests
public void failNRequests(int requestCount)
-
getResponse
protected abstract SimpleHttpServerBase.Response getResponse(String httpHeader)
-
createStringResponse
public static SimpleHttpServerBase.Response createStringResponse(String statusLine, List<String> headers, String content)
-
createStreamResponse
public static SimpleHttpServerBase.Response createStreamResponse(String statusLine, List<String> headers, byte[] content)
-
createStreamResponse
public static SimpleHttpServerBase.Response createStreamResponse(String statusLine, List<String> headers, InputStream content)
-
-