public class SqlGuardHttpServer extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_BODY_BYTES |
| Constructor and Description |
|---|
SqlGuardHttpServer(String host,
int port,
SqlGuardService service) |
| Modifier and Type | Method and Description |
|---|---|
InetSocketAddress |
address() |
static String |
httpGet(String url) |
static String |
httpPost(String url,
String body) |
static String |
readLimited(InputStream in,
int max)
Reads at most
max bytes from in, refusing input that exceeds the limit before it is buffered. |
void |
start() |
void |
stop(int delay) |
public static final int MAX_BODY_BYTES
public SqlGuardHttpServer(String host, int port, SqlGuardService service)
public void start() throws IOException
IOExceptionpublic void stop(int delay)
public InetSocketAddress address()
public static String readLimited(InputStream in, int max) throws IOException
max bytes from in, refusing input that exceeds the limit before it is buffered.
PUBLIC ON PURPOSE: every shipped jar is ProGuard-obfuscated under a compatibility-first policy that preserves public and protected members and renames everything else. A package-private method is therefore unreachable from the released jar, which is what the test suite runs against in the nightly obfuscated-jar gate. Keeping this public is what lets that gate execute the real shipped bytes.
IOExceptionpublic static String httpGet(String url) throws IOException
IOExceptionpublic static String httpPost(String url, String body) throws IOException
IOException