Class DeltaExtractionService

java.lang.Object
edu.university.ecs.lab.delta.services.DeltaExtractionService

public class DeltaExtractionService extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    private ChangeType
    The type of change that is made
    private final String
    The new commit for comparison
    private final String
    The old commit for comparison
    private final Config
    Config object representing the contents of the config file
    private static final String
     
    private final GitService
    GitService instance for interacting with the local repository
    private String
    The path to the output file
    private SystemChange
    System change object that will be returned
  • Constructor Summary

    Constructors
    Constructor
    Description
    DeltaExtractionService(String configPath, String outputPath, String commitOld, String commitNew)
    Constructor for the DeltaExtractionService
  • Method Summary

    Modifier and Type
    Method
    Description
    private com.google.gson.JsonObject
    add(String newPath)
    This method parses a newly added file into a JsonObject containing the data of the change (updated file).
    private com.google.gson.JsonObject
    This method returns a blank JsonObject() as there is no data to parse
    void
    Generates Delta file representing changes between commitOld and commitNew
    void
    processDelta(List<org.eclipse.jgit.diff.DiffEntry> diffEntries)
    Process differences between commits

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEV_NULL

      private static final String DEV_NULL
      See Also:
    • config

      private final Config config
      Config object representing the contents of the config file
    • gitService

      private final GitService gitService
      GitService instance for interacting with the local repository
    • commitOld

      private final String commitOld
      The old commit for comparison
    • commitNew

      private final String commitNew
      The new commit for comparison
    • systemChange

      private SystemChange systemChange
      System change object that will be returned
    • changeType

      private ChangeType changeType
      The type of change that is made
    • outputPath

      private String 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 file
      outputPath - output path for file
      commitOld - old commit for comparison
      commitNew - new commit for comparison
  • Method Details

    • generateDelta

      public void generateDelta()
      Generates Delta file representing changes between commitOld and commitNew
    • processDelta

      public void processDelta(List<org.eclipse.jgit.diff.DiffEntry> diffEntries)
      Process differences between commits
      Parameters:
      diffEntries - list of differences
    • add

      private com.google.gson.JsonObject add(String newPath)
      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