List of usage examples for org.eclipse.jgit.lfs.lib AnyLongObjectId getName
public final String getName()
From source file:com.googlesource.gerrit.plugins.lfs.fs.LfsFsContentServlet.java
License:Apache License
private Optional<AnyLongObjectId> validateGetRequest(HttpServletRequest req, HttpServletResponse rsp) throws IOException { AnyLongObjectId obj = getObjectToTransfer(req, rsp); if (obj == null) { return Optional.empty(); }/*from w w w. j a v a2 s .com*/ if (repository.getSize(obj) == -1) { sendError(rsp, HttpStatus.SC_NOT_FOUND, MessageFormat.format(LfsServerText.get().objectNotFound, obj.getName())); return Optional.empty(); } if (!authorizer.verifyAuthInfo(req.getHeader(HDR_AUTHORIZATION), DOWNLOAD, obj)) { sendError(rsp, HttpStatus.SC_UNAUTHORIZED, MessageFormat.format(LfsServerText.get().failedToCalcSignature, "Invalid authorization token")); return Optional.empty(); } return Optional.of(obj); }