GitHub Wiki and jGit [message #1404260] |
Wed, 30 July 2014 17:36 |
Dol Bik Messages: 9 Registered: April 2014 |
Junior Member |
|
|
Is it possible to access GitHub Wiki using jGit?
Let's take for example https://github.com/radiant/radiant/wiki. There are titles like "Installation", "The Basics", "Extensions", etc., links to other sites (as you can see on the right) and the corresponding descriptions.
How can I retrieve and parse those information with jGit?
I know how to access Git repositories with jGit, but I'm not sure if it's possible to access the GitHub Wiki as well.
This is what I have so far:
Repository repository = null;
try {
File localPath = File.createTempFile("TestGitRepository", "");
localPath.delete();
Git.cloneRepository()
.setURI("https://github.com/radiant/radiant.wiki.git")
.setDirectory(localPath).call();
Git git = Git.open(localPath);
repository = git.getRepository();
} catch (IOException | GitAPIException e) {
System.err.println("Caught Exception: " + e.getMessage());
e.printStackTrace();
} finally {
repository.close(); // Exception
}
But I get a java.lang.NullPointerException at repository.close();.
Thank you.
[Updated on: Wed, 30 July 2014 18:24] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02702 seconds