public class FileLocations extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
FileLocations.FileSystem
File system facade for test cases.
|
| Constructor and Description |
|---|
FileLocations() |
| Modifier and Type | Method and Description |
|---|---|
void |
addLine(String fileName,
int lineStart)
Adds the specified affected file and line number.
|
boolean |
contains(String fileName)
Returns whether the specified file has been added.
|
Set<String> |
getAbsolutePaths()
Returns the absolute file names of all files.
|
List<String> |
getErrorMessages() |
List<String> |
getInfoMessages() |
Set<Integer> |
getLines(String fileName)
Returns the added lines for the specified file.
|
Set<String> |
getRelativePaths()
Returns the relative file names of all files.
|
Set<String> |
getSkippedFiles() |
String |
getWorkspace() |
boolean |
isEmpty()
Returns whether some files have been added.
|
void |
logError(String format,
Object... args)
Logs the specified error message.
|
void |
logException(Exception exception,
String format,
Object... args)
Logs the specified exception.
|
void |
logInfo(String format,
Object... args)
Logs the specified information message.
|
void |
logSummary()
Writes a summary message to the reports' error log that denotes the total number of errors that have been
reported.
|
void |
setFileSystem(FileLocations.FileSystem fileSystem) |
void |
setWorkspace(File workspace)
Sets the Git workspace for all files that will be added later on.
|
void |
setWorkspace(String workspace)
Sets the Git workspace for all files that will be added later on.
|
int |
size()
Returns the number of files that have been added.
|
public void setWorkspace(File workspace)
workspace - the workspace to get the Git repository frompublic void setWorkspace(String workspace)
workspace - the workspace to get the Git repository frompublic String getWorkspace()
public void setFileSystem(FileLocations.FileSystem fileSystem)
public void addLine(String fileName, int lineStart)
workspace will be processed.fileName - the absolute file name that will be used as a keylineStart - the line number to find the blame forpublic boolean isEmpty()
true if there a no blames available, false otherwisepublic int size()
public boolean contains(String fileName)
fileName - the relative or absolute path of the filetrue if the file already has been added, false otherwisepublic Set<String> getRelativePaths()
public Set<String> getAbsolutePaths()
public Set<Integer> getLines(String fileName)
fileName - the relative or absolute path of the fileNoSuchElementException - if the file name is not registered@FormatMethod public void logInfo(String format, Object... args)
format - A format stringargs - Arguments referenced by the format specifiers in the format string. If there are more arguments than
format specifiers, the extra arguments are ignored. The number of arguments is variable and may be
zero.@FormatMethod public void logError(String format, Object... args)
format - A format stringargs - Arguments referenced by the format specifiers in the format string. If there are more arguments than
format specifiers, the extra arguments are ignored. The number of arguments is variable and may be
zero.@FormatMethod public void logException(Exception exception, String format, Object... args)
exception - the exception to logformat - A format stringargs - Arguments referenced by the format specifiers in the format string. If there are more arguments than
format specifiers, the extra arguments are ignored. The number of arguments is variable and may be
zero.public void logSummary()
Copyright © 2016–2019. All rights reserved.