Package org.jacoco.report.internal
Class ReportOutputFolder
java.lang.Object
org.jacoco.report.internal.ReportOutputFolder
Logical representation of a folder in the output structure. This utility
ensures valid and unique file names and helps to create relative links.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final NormalizedFileNames
private final IMultiReportOutput
private final ReportOutputFolder
private final String
private final Map
<String, ReportOutputFolder> Cached sub-folder instances to guarantee stable normalization -
Constructor Summary
ConstructorsModifierConstructorDescriptionReportOutputFolder
(IMultiReportOutput output) Creates a new root folder for the given output.private
ReportOutputFolder
(IMultiReportOutput output, ReportOutputFolder parent, String path) Creates a new root folder for the given output. -
Method Summary
Modifier and TypeMethodDescriptioncreateFile
(String name) Creates a new file in this folder with the given local name.getLink
(ReportOutputFolder base, String name) Returns a link relative to a given base to a resource within this folder.private boolean
isAncestorOf
(ReportOutputFolder folder) private String
Creates a sub-folder with the given name.
-
Field Details
-
output
-
parent
-
path
-
subFolders
Cached sub-folder instances to guarantee stable normalization -
fileNames
-
-
Constructor Details
-
ReportOutputFolder
Creates a new root folder for the given output.- Parameters:
output
- output for generated files
-
ReportOutputFolder
Creates a new root folder for the given output.- Parameters:
output
- output for generated files
-
-
Method Details
-
subFolder
Creates a sub-folder with the given name.- Parameters:
name
- name of the sub-folder- Returns:
- handle for output into the sub-folder
-
createFile
Creates a new file in this folder with the given local name.- Parameters:
name
- name of the sub-folder- Returns:
- handle for output into the sub-folder
- Throws:
IOException
- if the file creation fails
-
getLink
Returns a link relative to a given base to a resource within this folder.- Parameters:
base
- base to create the relative link fromname
- name of the file or folder in this folder- Returns:
- relative link
- Throws:
IllegalArgumentException
- if this folder and the base do not have the same root
-
isAncestorOf
-
normalize
-