Package org.eclipse.jgit.diff
Class ContentSource.Pair
- java.lang.Object
-
- org.eclipse.jgit.diff.ContentSource.Pair
-
- Enclosing class:
- ContentSource
public static final class ContentSource.Pair extends java.lang.ObjectA pair of sources to access the old and new sides of a DiffEntry.
-
-
Field Summary
Fields Modifier and Type Field Description private ContentSourcenewSourceprivate ContentSourceoldSource
-
Constructor Summary
Constructors Constructor Description Pair(ContentSource oldSource, ContentSource newSource)Construct a pair of sources.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectLoaderopen(DiffEntry.Side side, DiffEntry ent)Open the object.longsize(DiffEntry.Side side, DiffEntry ent)Determine the size of the object.
-
-
-
Field Detail
-
oldSource
private final ContentSource oldSource
-
newSource
private final ContentSource newSource
-
-
Constructor Detail
-
Pair
public Pair(ContentSource oldSource, ContentSource newSource)
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 Detail
-
size
public long size(DiffEntry.Side side, DiffEntry ent) throws java.io.IOException
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:
java.io.IOException- the file cannot be accessed.
-
open
public ObjectLoader open(DiffEntry.Side side, DiffEntry ent) throws java.io.IOException
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:
java.io.IOException- the file cannot be accessed.
-
-