Top Description Fields Constructors Methods
org.h2.server.web

pack-priv Class WebThread

extends WebApp
implements Runnable
Class Inheritance
All Implemented Interfaces
java.lang.Runnable
Imports
java.io.BufferedInputStream, .BufferedOutputStream, .IOException, .InputStream, .OutputStream, java.net.Socket, .UnknownHostException, java.nio.charset.StandardCharsets, java.util.Iterator, .Locale, .Properties, .StringTokenizer, org.h2.engine.SysProperties, org.h2.message.DbException, org.h2.util.IOUtils, .NetUtils, .NetworkConnectionInfo, .StringUtils, .Utils, .Utils21

For each connection to a session, an object of this class is created. This class is used by the H2 Console.

Field Summary

Modifier and TypeField and Description
private int
private String
private String
private InputStream
protected OutputStream
private static final byte[]
private static final byte[]
protected final Socket
private final Thread
Inherited from org.h2.server.web.WebApp:
attributescacheheaderLanguagemimeTypeserversessionstop

Constructor Summary

AccessConstructor and Description
pack-priv
WebThread(Socket socket, WebServer server)

Method Summary

Modifier and TypeMethod and Description
protected String
adminShutdown()

Overrides org.h2.server.web.WebApp.adminShutdown.

Stop the application and the server.

private boolean
private boolean
private String
getAllowedFile(String requestedFile)

private static String
pack-priv void
join(int
the maximum number of milliseconds to wait
millis
)

Wait until the thread is stopped.

private void
private void
private boolean
private boolean
private String
public void
run()

Implements java.lang.Runnable.run.

Runs this operation.

pack-priv void
start()

Start the thread.

pack-priv void
stopNow()

Close the connection now.

private void
private void
writeSimple(String status, String text)

private void
writeSimple(String status, byte[] bytes)

Inherited from org.h2.server.web.WebApp:
getCachegetMimeTypegetSessionprocessRequestquerysetSession

Field Detail

dataLengthback to summary
private int dataLength
hostback to summary
private String host
ifModifiedSinceback to summary
private String ifModifiedSince
inputback to summary
private InputStream input
outputback to summary
protected OutputStream output
RNback to summary
private static final byte[] RN
RNRNback to summary
private static final byte[] RNRN
socketback to summary
protected final Socket socket
threadback to summary
private final Thread thread

Constructor Detail

WebThreadback to summary
pack-priv WebThread(Socket socket, WebServer server)

Method Detail

adminShutdownback to summary
protected String adminShutdown()

Overrides org.h2.server.web.WebApp.adminShutdown.

Doc from org.h2.server.web.WebApp.adminShutdown.

Stop the application and the server.

Returns:String

the page to display

Annotations
@Override
allowback to summary
private boolean allow()
checkHostback to summary
private boolean checkHost(String host) throws IOException
getAllowedFileback to summary
private String getAllowedFile(String requestedFile)
getHeaderLineValueback to summary
private static String getHeaderLineValue(String line)
joinback to summary
pack-priv void join(int millis) throws InterruptedException

Wait until the thread is stopped.

Parameters
millis:int

the maximum number of milliseconds to wait

Exceptions
InterruptedException:
if interrupted
parseAttributesback to summary
private void parseAttributes(String s)
parseBodyAttributesback to summary
private void parseBodyAttributes() throws IOException
parseHeaderback to summary
private boolean parseHeader() throws IOException
processback to summary
private boolean process() throws IOException
Annotations
@SuppressWarnings:unchecked
readHeaderLineback to summary
private String readHeaderLine() throws IOException
runback to summary
public void run()

Implements java.lang.Runnable.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override
startback to summary
pack-priv void start()

Start the thread.

stopNowback to summary
pack-priv void stopNow()

Close the connection now.

traceback to summary
private void trace(String s)

Hides org.h2.server.web.WebApp.trace.

writeSimpleback to summary
private void writeSimple(String status, String text) throws IOException
writeSimpleback to summary
private void writeSimple(String status, byte[] bytes) throws IOException