public NanoHTTPD(String hostname, int port) { this.hostname = hostname; this.myPort = port; setTempFileManagerFactory(new DefaultTempFileManagerFactory()); setAsyncRunner(new DefaultAsyncRunner()); }
protected void sendBodyWithCorrectTransferAndEncoding(OutputStream outputStream, long pending) throws IOException { if (this.requestMethod != Method.HEAD && this.chunkedTransfer) { ChunkedOutputStream chunkedOutputStream = new ChunkedOutputStream(outputStream); sendBodyWithCorrectEncoding(chunkedOutputStream, -1); chunkedOutputStream.finish(); } else { sendBodyWithCorrectEncoding(outputStream, pending); } }
public void unloadQueue(Response response) { for (Cookie cookie : this.queue) { response.addHeader("Set-Cookie", cookie.getHTTPHeader()); } } }
/** * Code t. * * @param <T> the type parameter * @param fn the fn * @return the t */ default <T> T eval(final UncheckedSupplier<T> fn) { return eval(fn, getMaxOutSize(), 3); }
/** * Out. * * @param fmt the fmt * @param args the args */ default void out(final CharSequence fmt, final Object... args) { p(fmt, args); }
/** * Code t. * * @param <T> the type parameter * @param fn the fn * @return the t */ default <T> T out(final UncheckedSupplier<T> fn) { return eval(fn, Integer.MAX_VALUE, 3); }
public Cookie(String name, String value, int numDays) { this.n = name; this.v = value; this.e = getHTTPTime(numDays); }
@Override public TempFileManager create() { return new DefaultTempFileManager(); } }
private String getRead() throws JsonProcessingException { return "<html><body style=\"margin: 0;\">" + "<textarea name=\"" + formVar + "\" style=\"margin: 0px; width: " + width + "; height: " + height2 + ";\">" + getString(value) + "</textarea>" + "</body></html>"; }
@Override public FileHTTPD getHttpd() { return new NullHTTPD(); }
@Override public void write(int b) throws IOException { byte[] data = { (byte) b }; write(data, 0, 1); }
/** * To html table string. * * @return the string */ public String toHtmlTable() { return toHtmlTable(false); }
public NanoHTTPD(String hostname, int port) { this.hostname = hostname; this.myPort = port; setTempFileManagerFactory(new DefaultTempFileManagerFactory()); setAsyncRunner(new DefaultAsyncRunner()); }
protected void sendBodyWithCorrectTransferAndEncoding(OutputStream outputStream, long pending) throws IOException { if (this.requestMethod != Method.HEAD && this.chunkedTransfer) { ChunkedOutputStream chunkedOutputStream = new ChunkedOutputStream(outputStream); sendBodyWithCorrectEncoding(chunkedOutputStream, -1); chunkedOutputStream.finish(); } else { sendBodyWithCorrectEncoding(outputStream, pending); } }
/** * Out. * * @param fmt the fmt * @param args the args */ default void out(final CharSequence fmt, final Object... args) { p(fmt, args); }
public void unloadQueue(Response response) { for (Cookie cookie : this.queue) { response.addHeader("Set-Cookie", cookie.getHTTPHeader()); } } }
public Cookie(String name, String value, int numDays) { this.n = name; this.v = value; this.e = getHTTPTime(numDays); }
@Override public TempFileManager create() { return new DefaultTempFileManager(); } }
private String getRead() throws JsonProcessingException { return "<html><body style=\"margin: 0;\">" + "<textarea name=\"" + formVar + "\" style=\"margin: 0px; width: " + width + "; height: " + height2 + ";\">" + getString(value) + "</textarea>" + "</body></html>"; }
@Override public FileHTTPD getHttpd() { return new NullHTTPD(); }