/** * Send push promise to the client. * * @param method HTTP method. * @param path HTTP path. * @param headers HTTP headers. * @throws Exception If something goes wrong. */ default void push(final String method, final String path, final Map<String, Object> headers) throws Exception { upgrade(NativePushPromise.class).push(method, path, headers); }
@Override public String name() { return upload.name(); }
@Override public String rawPath() { return req.rawPath(); }
@Override protected void _send(final byte[] bytes) throws Exception { rsp.send(bytes); }
@Override public boolean secure() { return req.secure(); }
@Override public boolean isOpen() { return open && ws.isOpen(); }
@Override public void close() throws IOException { upload.close(); }
@Override public File file() throws IOException { return upload.file(); }
@Override public Optional<String> queryString() { return req.queryString(); }
@Override public List<Cookie> cookies() { return req.cookies(); }
@Override public boolean committed() { return rsp.committed(); }
@Override public String ip() { return req.ip(); }
@Override public String protocol() { return req.protocol(); }
@Override public Response length(final long length) { len = length; rsp.header("Content-Length", Long.toString(length)); return this; }
@Override public void pause() { removeSession(this); synchronized (this) { if (!suspended) { ws.pause(); suspended = true; } } }
private List<String> paramNames() { try { return req.paramNames(); } catch (Exception ex) { throw new Err(Status.BAD_REQUEST, "Unable to get parameter names", ex); } }
@Override protected void _send(final ByteBuffer buffer) throws Exception { rsp.send(buffer); }