Module org.eclipse.jgit
Class CommitGraphLoader
java.lang.Object
org.eclipse.jgit.internal.storage.commitgraph.CommitGraphLoader
The loader returns the representation of the commit-graph file content.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CommitGraph
Open an existing commit-graph file for reading.static CommitGraph
read
(InputStream fd) Read an existing commit-graph file from a buffered stream.
-
Constructor Details
-
CommitGraphLoader
public CommitGraphLoader()
-
-
Method Details
-
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
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.
-