Example usage for org.eclipse.jgit.errors RevisionSyntaxException RevisionSyntaxException

List of usage examples for org.eclipse.jgit.errors RevisionSyntaxException RevisionSyntaxException

Introduction

In this page you can find the example usage for org.eclipse.jgit.errors RevisionSyntaxException RevisionSyntaxException.

Prototype

public RevisionSyntaxException(String message, String revstr) 

Source Link

Document

Construct a RevisionSyntaxException indicating a syntax problem with a revision (or object) string.

Usage

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);
    }
}