org.jacoco.report.internal

## Class ReportOutputFolder

- java.lang.Object
- - org.jacoco.report.internal.ReportOutputFolder

    public class ReportOutputFolder
    extends Object

Logical representation of a folder in the output structure. This utility ensures valid and unique file names and helps to create relative links.

### Constructor Summary

Constructors
Constructor and Description
`ReportOutputFolder(IMultiReportOutput output)` Creates a new root folder for the given output.

### Method Summary

All Methods Instance Methods Concrete Methods
`OutputStream` `createFile(String name)` Creates a new file in this folder with the given local name.
`String` `getLink(ReportOutputFolder base, String name)` Returns a link relative to a given base to a resource within this folder.
`ReportOutputFolder` `subFolder(String name)` Creates a sub-folder with the given name.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ReportOutputFolder

    public ReportOutputFolder(IMultiReportOutput output)

Creates a new root folder for the given output.

Parameters:
  `output` - output for generated files

### Method Detail

#### subFolder

    public ReportOutputFolder subFolder(String name)

Creates a sub-folder with the given name.

Parameters:
  `name` - name of the sub-folder
Returns:
  handle for output into the sub-folder

#### createFile

    public OutputStream createFile(String name)
                            throws IOException

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

    public String getLink(ReportOutputFolder base,
                          String name)

Returns a link relative to a given base to a resource within this folder.

Parameters:
  `base` - base to create the relative link from
  `name` - 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