List of usage examples for org.eclipse.jgit.errors RevisionSyntaxException RevisionSyntaxException
public RevisionSyntaxException(String message, String revstr)
From source file:com.googlesource.gerrit.plugins.supermanifest.Utils.java
License:Apache License
public static byte[] readBlob(Repository repo, String idStr) throws IOException { try (ObjectReader reader = repo.newObjectReader()) { ObjectId id = repo.resolve(idStr); if (id == null) { throw new RevisionSyntaxException(String.format("repo %s does not have %s", repo.toString(), idStr), idStr);/*from ww w . j a va 2 s.com*/ } return reader.open(id).getCachedBytes(Integer.MAX_VALUE); } }