Class DefaultReceivePackFactory
java.lang.Object
org.eclipse.jgit.http.server.resolver.DefaultReceivePackFactory
- All Implemented Interfaces:
ReceivePackFactory<javax.servlet.http.HttpServletRequest>
public class DefaultReceivePackFactory
extends Object
implements ReceivePackFactory<javax.servlet.http.HttpServletRequest>
Create and configure
ReceivePack service
instance.
Writing by receive-pack is permitted if any of the following is true:
- The container has authenticated the user and set
HttpServletRequest.getRemoteUser()to the authenticated name. - The repository configuration file has
http.receivepackexplicitly set to true.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.eclipse.jgit.transport.resolver.ReceivePackFactory
DISABLED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(javax.servlet.http.HttpServletRequest req, Repository db) Create and configure a new ReceivePack instance for a repository.private static ReceivePackcreateFor(javax.servlet.http.HttpServletRequest req, Repository db, String user) private static PersonIdenttoPersonIdent(javax.servlet.http.HttpServletRequest req, String user)
-
Constructor Details
-
DefaultReceivePackFactory
public DefaultReceivePackFactory()
-
-
Method Details
-
create
public ReceivePack create(javax.servlet.http.HttpServletRequest req, Repository db) throws ServiceNotEnabledException, ServiceNotAuthorizedException Create and configure a new ReceivePack instance for a repository.- Specified by:
createin interfaceReceivePackFactory<javax.servlet.http.HttpServletRequest>- Parameters:
req- current request, in case information from the request may help configure the ReceivePack instance.db- the repository the receive would write into.- Returns:
- the newly configured ReceivePack instance, must not be null.
- Throws:
ServiceNotEnabledException- this factory refuses to create the instance because it is not allowed on the target repository, by any user.ServiceNotAuthorizedException- this factory refuses to create the instance for this HTTP request and repository, such as due to a permission error.
-
createFor
private static ReceivePack createFor(javax.servlet.http.HttpServletRequest req, Repository db, String user) -
toPersonIdent
-