Module org.eclipse.jgit
Class CommitGraphLoader
- java.lang.Object
-
- org.eclipse.jgit.internal.storage.commitgraph.CommitGraphLoader
-
public class CommitGraphLoader extends Object
The loader returns the representation of the commit-graph file content.
-
-
Constructor Summary
Constructors Constructor Description CommitGraphLoader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CommitGraphopen(File graphFile)Open an existing commit-graph file for reading.static CommitGraphread(InputStream fd)Read an existing commit-graph file from a buffered stream.
-
-
-
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.
-
-