Top Description Fields Constructors Methods
org.eclipse.jgit.junit.http

public Class SimpleHttpServer

extends Object
Class Inheritance
Imports
java.net.URI, .URISyntaxException, jakarta.servlet.http.HttpServletRequest, org.eclipse.jetty.ee10.servlet.ServletContextHandler, .ServletHolder, org.eclipse.jgit.errors.RepositoryNotFoundException, org.eclipse.jgit.http.server.GitServlet, org.eclipse.jgit.lib.Repository, org.eclipse.jgit.transport.URIish

Simple http server for testing http access to Git repositories. Authentication with hardcoded credentials user:agitter password:letmein.

Field Summary

Modifier and TypeField and Description
private final Repository
private URIish
pack-priv AppServer
private URIish

Constructor Summary

AccessConstructor and Description
public
SimpleHttpServer(Repository
the repository
repository
)

Constructor for SimpleHttpServer.

public
SimpleHttpServer(Repository
the repository
repository
,
boolean
whether to encrypt the communication
withSsl
)

Constructor for SimpleHttpServer.

Method Summary

Modifier and TypeMethod and Description
public URIish

Returns:

the secure uri
getSecureUri
()

Get the secureUri.

public URIish

Returns:

the uri
getUri
()

Get the uri.

private static String
private ServletContextHandler
smart(String path)

public void
start()

Start the server

public void
stop()

Stop the server.

private URIish
private URIish
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dbback to summary
private final Repository db
secureUriback to summary
private URIish secureUri
serverback to summary
pack-priv AppServer server
uriback to summary
private URIish uri

Constructor Detail

SimpleHttpServerback to summary
public SimpleHttpServer(Repository repository)

Constructor for SimpleHttpServer.

Parameters
repository:Repository

the repository

SimpleHttpServerback to summary
public SimpleHttpServer(Repository repository, boolean withSsl)

Constructor for SimpleHttpServer.

Parameters
repository:Repository

the repository

withSsl:boolean

whether to encrypt the communication

Method Detail

getSecureUriback to summary
public URIish getSecureUri()

Get the secureUri.

Returns:URIish

the secure uri

getUriback to summary
public URIish getUri()

Get the uri.

Returns:URIish

the uri

nameOfback to summary
private static String nameOf(Repository db)
smartback to summary
private ServletContextHandler smart(String path)
startback to summary
public void start() throws Exception

Start the server

Exceptions
Exception:
if an error occurred
stopback to summary
public void stop() throws Exception

Stop the server.

Exceptions
Exception:
if an error occurred
toURIishback to summary
private URIish toURIish(String path) throws URISyntaxException
toURIishback to summary
private URIish toURIish(ServletContextHandler app, String name) throws URISyntaxException