List of usage examples for org.eclipse.jgit.lfs.server.fs ObjectUploadListener ObjectUploadListener
public ObjectUploadListener(FileLfsRepository repository, AsyncContext context, HttpServletRequest request, HttpServletResponse response, AnyLongObjectId id) throws FileNotFoundException, IOException
From source file:com.googlesource.gerrit.plugins.lfs.fs.LfsFsContentServlet.java
License:Apache License
@Override protected void doPut(HttpServletRequest req, HttpServletResponse rsp) throws ServletException, IOException { AnyLongObjectId id = getObjectToTransfer(req, rsp); if (id == null) { return;//w w w. ja v a2 s. c om } if (!authorizer.verifyAuthInfo(req.getHeader(HDR_AUTHORIZATION), UPLOAD, id)) { sendError(rsp, HttpStatus.SC_UNAUTHORIZED, MessageFormat.format(LfsServerText.get().failedToCalcSignature, "Invalid authorization token")); return; } AsyncContext context = req.startAsync(); context.setTimeout(timeout); req.getInputStream().setReadListener(new ObjectUploadListener(repository, context, req, rsp, id)); }