Autopsy  4.19.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Classes | Private Member Functions | Static Private Attributes | List of all members
org.sleuthkit.autopsy.integrationtesting.DiffService Class Reference

Classes

class  DiffServiceException
 

Private Member Functions

String diffLines (List< String > orig, List< String > cur, String header)
 
String getChunkLineNumString (Chunk<?> chunk)
 
String getDiffLineNumString (Chunk<?> orig, Chunk<?> cur)
 
String getFileDiffs (File orig, File cur, String identifier)
 
String getHeaderWithDivider (String remark)
 
List< String > getLinesDiff (Chunk< String > orig, Chunk< String > cur)
 
String getLinesDiffString (AbstractDelta< String > delta)
 
String getRelative (File rootDirectory, File file)
 

Static Private Attributes

static final String CUR_LINE_PREFIX = "> "
 
static final String[] DIFF_BREAK = new String[]{"", "", ""}
 
static final String[] FILE_DIFF_BREAK = new String[]{"", "", "", ""}
 
static final String NEW_LINE = System.getProperty("line.separator")
 
static final String ORIG_LINE_PREFIX = "< "
 

Detailed Description

Handles creating diffs with files.

Definition at line 40 of file DiffService.java.

Member Function Documentation

String org.sleuthkit.autopsy.integrationtesting.DiffService.diffLines ( List< String >  orig,
List< String >  cur,
String  header 
)
private

Creates a line difference String with a header if non-null. Null is returned if there is no diff.

Parameters
origThe original lines.
curThe current lines.
headerThe header to be used if non-null diff. If header is null, no header included.
Returns
The pretty-printed diff.

Definition at line 195 of file DiffService.java.

References org.sleuthkit.autopsy.integrationtesting.DiffService.getLinesDiffString().

Referenced by org.sleuthkit.autopsy.integrationtesting.DiffService.getFileDiffs().

String org.sleuthkit.autopsy.integrationtesting.DiffService.getChunkLineNumString ( Chunk<?>  chunk)
private
String org.sleuthkit.autopsy.integrationtesting.DiffService.getDiffLineNumString ( Chunk<?>  orig,
Chunk<?>  cur 
)
private

Gets a github-like line difference (i.e. -88,3 +90,3) of the form -orig_line_num,orig_lines, +new_line_num,new_lines.

Parameters
origThe previous chunk.
curThe current chunk.
Returns
The line number difference.

Definition at line 153 of file DiffService.java.

References org.sleuthkit.autopsy.integrationtesting.DiffService.getChunkLineNumString().

Referenced by org.sleuthkit.autopsy.integrationtesting.DiffService.getLinesDiffString().

String org.sleuthkit.autopsy.integrationtesting.DiffService.getFileDiffs ( File  orig,
File  cur,
String  identifier 
)
private

Handles creating a diff between files noting if one of them is not present. If both are not present or both are the same, null is returned.

Parameters
origThe original file.
curThe current file.
identifierThe identifier for the header.
Returns
The String representing the differences.

Definition at line 122 of file DiffService.java.

References org.sleuthkit.autopsy.integrationtesting.DiffService.diffLines(), org.sleuthkit.autopsy.integrationtesting.DiffService.getHeaderWithDivider(), and org.sleuthkit.autopsy.integrationtesting.DiffService.NEW_LINE.

String org.sleuthkit.autopsy.integrationtesting.DiffService.getHeaderWithDivider ( String  remark)
private
List<String> org.sleuthkit.autopsy.integrationtesting.DiffService.getLinesDiff ( Chunk< String >  orig,
Chunk< String >  cur 
)
private

Creates a line by line difference similar to integration tests like: < original

new

Parameters
origThe original chunk.
curThe new chunk.
Returns
The lines representing the diff.

Definition at line 166 of file DiffService.java.

Referenced by org.sleuthkit.autopsy.integrationtesting.DiffService.getLinesDiffString().

String org.sleuthkit.autopsy.integrationtesting.DiffService.getLinesDiffString ( AbstractDelta< String >  delta)
private
String org.sleuthkit.autopsy.integrationtesting.DiffService.getRelative ( File  rootDirectory,
File  file 
)
private

Definition at line 217 of file DiffService.java.

Member Data Documentation

final String org.sleuthkit.autopsy.integrationtesting.DiffService.CUR_LINE_PREFIX = "> "
staticprivate

Definition at line 70 of file DiffService.java.

final String [] org.sleuthkit.autopsy.integrationtesting.DiffService.DIFF_BREAK = new String[]{"", "", ""}
staticprivate

Definition at line 71 of file DiffService.java.

final String [] org.sleuthkit.autopsy.integrationtesting.DiffService.FILE_DIFF_BREAK = new String[]{"", "", "", ""}
staticprivate

Definition at line 72 of file DiffService.java.

final String org.sleuthkit.autopsy.integrationtesting.DiffService.NEW_LINE = System.getProperty("line.separator")
staticprivate
final String org.sleuthkit.autopsy.integrationtesting.DiffService.ORIG_LINE_PREFIX = "< "
staticprivate

Definition at line 69 of file DiffService.java.


The documentation for this class was generated from the following file:

Copyright © 2012-2021 Basis Technology. Generated on: Fri Aug 6 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.