/** {@inheritDoc} */ @Override public void onAllDataRead() throws IOException { close(); }
/** * {@inheritDoc} * * Handle object uploads */ @Override protected void doPut(HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException { AnyLongObjectId id = getObjectToTransfer(req, rsp); if (id != null) { AsyncContext context = req.startAsync(); context.setTimeout(timeout); req.getInputStream().setReadListener(new ObjectUploadListener( repository, context, req, rsp, id)); } }
/** * Handle object uploads * * @param req * servlet request * @param rsp * servlet response * @throws ServletException * if a servlet-specific error occurs * @throws IOException * if an I/O error occurs */ @Override protected void doPut(HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException { AnyLongObjectId id = getObjectToTransfer(req, rsp); if (id != null) { AsyncContext context = req.startAsync(); context.setTimeout(timeout); req.getInputStream().setReadListener(new ObjectUploadListener( repository, context, req, rsp, id)); } }
/** * @throws IOException */ @Override public void onAllDataRead() throws IOException { close(); }
/** * {@inheritDoc} * * Writes all the received data to the output channel */ @Override public void onDataAvailable() throws IOException { while (in.isReady()) { if (inChannel.read(buffer) > 0) { buffer.flip(); channel.write(buffer); buffer.compact(); } else { buffer.flip(); while (buffer.hasRemaining()) { channel.write(buffer); } close(); return; } } }
/** * Writes all the received data to the output channel * * @throws IOException */ @Override public void onDataAvailable() throws IOException { while (in.isReady()) { if (inChannel.read(buffer) > 0) { buffer.flip(); channel.write(buffer); buffer.compact(); } else { buffer.flip(); while (buffer.hasRemaining()) { channel.write(buffer); } close(); return; } } }