List of usage examples for org.eclipse.jgit.treewalk CanonicalTreeParser next
@Override public void next(int delta)
From source file:de.codesourcery.gittimelapse.GitHelper.java
License:Apache License
protected void readFile(String path, PathFilter filter, RevCommit current, final ByteArrayOutputStream buffer) throws MissingObjectException, IncorrectObjectTypeException, CorruptObjectException, IOException { final String strippedPath = stripRepoBaseDir(path); final ITreeVisitor visitor = new ITreeVisitor() { @Override// w ww. j a va 2 s . c o m public boolean visit(TreeWalk treeWalk) throws MissingObjectException, IOException { final CanonicalTreeParser parser = treeWalk.getTree(0, CanonicalTreeParser.class); while (!parser.eof()) { if (parser.getEntryPathString().equals(strippedPath)) { ObjectLoader loader = repository.open(parser.getEntryObjectId()); buffer.write(loader.getBytes()); } parser.next(1); } return true; } }; visitCommitTree(path, filter, current, visitor); }