Class CommitGraphLoader


  • public class CommitGraphLoader
    extends Object
    The loader returns the representation of the commit-graph file content.
    • Constructor Detail

      • CommitGraphLoader

        public CommitGraphLoader()
    • Method Detail

      • open

        public static CommitGraph open​(File graphFile)
                                throws FileNotFoundException,
                                       CommitGraphFormatException,
                                       IOException
        Open an existing commit-graph file for reading.

        The format of the file will be automatically detected and a proper access implementation for that format will be constructed and returned to the caller. The file may or may not be held open by the returned instance.

        Parameters:
        graphFile - existing commit-graph to read.
        Returns:
        a copy of the commit-graph file in memory
        Throws:
        FileNotFoundException - the file does not exist.
        CommitGraphFormatException - commit-graph file's format is different from we expected.
        IOException - the file exists but could not be read due to security errors or unexpected data corruption.
      • read

        public static CommitGraph read​(InputStream fd)
                                throws CommitGraphFormatException,
                                       IOException
        Read an existing commit-graph file from a buffered stream.

        The format of the file will be automatically detected and a proper access implementation for that format will be constructed and returned to the caller. The file may or may not be held open by the returned instance.

        Parameters:
        fd - stream to read the commit-graph file from. The stream must be buffered as some small IOs are performed against the stream. The caller is responsible for closing the stream.
        Returns:
        a copy of the commit-graph file in memory
        Throws:
        CommitGraphFormatException - the commit-graph file's format is different from we expected.
        IOException - the stream cannot be read.