java.lang.Object
org.eclipse.jgit.diff.ContentSource.Pair
- Enclosing class:
- ContentSource
A pair of sources to access the old and new sides of a DiffEntry.
-
Constructor Summary
ConstructorsConstructorDescriptionPair
(ContentSource oldSource, ContentSource newSource) Construct a pair of sources. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes used resources.boolean
Checks if source (side) is a "working tree".open
(DiffEntry.Side side, DiffEntry ent) Open the object.long
size
(DiffEntry.Side side, DiffEntry ent) Determine the size of the object.
-
Constructor Details
-
Pair
Construct a pair of sources.- Parameters:
oldSource
- source to read the old side of a DiffEntry.newSource
- source to read the new side of a DiffEntry.
-
-
Method Details
-
size
Determine the size of the object.- Parameters:
side
- which side of the entry to read (OLD or NEW).ent
- the entry to examine.- Returns:
- the size in bytes.
- Throws:
IOException
- the file cannot be accessed.
-
open
Open the object.- Parameters:
side
- which side of the entry to read (OLD or NEW).ent
- the entry to examine.- Returns:
- a loader that can supply the content of the file. The loader must be used before another loader can be obtained from this same source.
- Throws:
IOException
- the file cannot be accessed.
-
close
public void close()Closes used resources.- Since:
- 6.2
-
isWorkingTreeSource
Checks if source (side) is a "working tree".- Parameters:
side
- which side of the entry to read (OLD or NEW).- Returns:
- is the source a "working tree"
- Since:
- 6.2
-