/** * Get the contents of the blob in the commit located at the given path. * * @param repository * @param commitId * @param path * @return contents or null if no blob with path at given commit */ public static String getContent(final Repository repository, final ObjectId commitId, final String path) { return toString(repository, getRawContent(repository, commitId, path)); }
/** * Get the contents of the blob at the given path in the commit that the * revision references. * * @param repository * @param revision * @param path * @return contents or null if no blob with path at given revision */ public static String getContent(final Repository repository, final String revision, final String path) { return toString(repository, getRawContent(repository, revision, path)); }
/** * Get the contents of the the blob with the given id as a UTF-8 * {@link String}. * * @param repository * @param id * @return content of blob as UTF-8 string */ public static String getContent(final Repository repository, final ObjectId id) { if (repository == null) throw new IllegalArgumentException( Assert.formatNotNull("Repository")); if (id == null) throw new IllegalArgumentException( Assert.formatNotNull("Object id")); return toString(repository, getBytes(repository, id)); }