I need to validate, if repository uri is valid without clone of repository.
So I use the next command for that:
Transport transport = Transport.open("http : // server.domain.com/TestGitPluginRepo.git");
Connection connection = transport.openFetch();
connection.getRefs();
It worked ok.
But recently I found, that transport.openFetch() throws NullPointerException when git server uses Dumb HTTP (the server doesn't support Smart HTTP).
[INFO] [talledLocalContainer] java.lang.NullPointerException
[INFO] [talledLocalContainer] at org.eclipse.jgit.transport.WalkFetchConnection.<init>(WalkFetchConnection.java:197)
[INFO] [talledLocalContainer] at org.eclipse.jgit.transport.TransportHttp.newDumbConnection(TransportHttp.java:384)
[INFO] [talledLocalContainer] at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:319)
[INFO] [talledLocalContainer] at com.mypackage.wizard.WizardConnectionValidator.isHttpAuthenticationRequired(WizardConnectionValidator.java:285)
Is there some workaround?
or
How can I validate, if repository uri is valid without clone of repository.
FYI: I'm sure, that url is correct, because I can clone the repository from console, i.e.
git clone http : // server.domain.com/TestGitPluginRepo.git
clones repository successfully.