Class SrcContentResolver


  • public class SrcContentResolver
    extends Object
    Resolver of the source content of a specific file
    • Method Detail

      • getSourceContent

        public static byte[] getSourceContent​(org.eclipse.jgit.lib.Repository repo,
                                              org.eclipse.jgit.lib.ObjectId id,
                                              org.eclipse.jgit.lib.FileMode fileMode)
                                       throws IOException
        Return the source content of a specific file.
        Parameters:
        repo - Git repository.
        id - Git Object ID of the file blob.
        fileMode - File mode of the underlying file as recognized by Git.
        Returns:
        byte[] source content of the underlying file if the id is of type blob, or a textual representation of the file if it is a git submodule.
        Throws:
        IOException - the object ID does not exist in the repository or cannot be accessed.