Class DeltaExtractionService
java.lang.Object
edu.university.ecs.lab.delta.services.DeltaExtractionService
Service for extracting the differences between two commits of a repository.
This class does cleaning of output so not all changes will be reflected in
the Delta output file.
-
Field Summary
Modifier and TypeFieldDescriptionprivate ChangeType
The type of change that is madeprivate final String
The new commit for comparisonprivate final String
The old commit for comparisonprivate final Config
Config object representing the contents of the config fileprivate static final String
private final GitService
GitService instance for interacting with the local repositoryprivate String
The path to the output fileprivate SystemChange
System change object that will be returned -
Constructor Summary
ConstructorDescriptionDeltaExtractionService
(String configPath, String outputPath, String commitOld, String commitNew) Constructor for the DeltaExtractionService -
Method Summary
Modifier and TypeMethodDescriptionprivate com.google.gson.JsonObject
This method parses a newly added file into a JsonObject containing the data of the change (updated file).private com.google.gson.JsonObject
delete()
This method returns a blank JsonObject() as there is no data to parsevoid
Generates Delta file representing changes between commitOld and commitNewvoid
processDelta
(List<org.eclipse.jgit.diff.DiffEntry> diffEntries) Process differences between commits
-
Field Details
-
DEV_NULL
- See Also:
-
config
Config object representing the contents of the config file -
gitService
GitService instance for interacting with the local repository -
commitOld
The old commit for comparison -
commitNew
The new commit for comparison -
systemChange
System change object that will be returned -
changeType
The type of change that is made -
outputPath
The path to the output file
-
-
Constructor Details
-
DeltaExtractionService
public DeltaExtractionService(String configPath, String outputPath, String commitOld, String commitNew) Constructor for the DeltaExtractionService- Parameters:
configPath
- path to the config fileoutputPath
- output path for filecommitOld
- old commit for comparisoncommitNew
- new commit for comparison
-
-
Method Details
-
generateDelta
public void generateDelta()Generates Delta file representing changes between commitOld and commitNew -
processDelta
Process differences between commits- Parameters:
diffEntries
- list of differences
-
add
This method parses a newly added file into a JsonObject containing the data of the change (updated file). Returns a blank JsonObject if parsing fails (returns null).- Parameters:
newPath
- git path of new file- Returns:
- JsonObject of data of the new file
-
delete
private com.google.gson.JsonObject delete()This method returns a blank JsonObject() as there is no data to parse- Returns:
- JsonObject that is empty
-