class TaskGenerateIndexTs extends AbstractTaskClientGenerator {

    @Override
    protected String getFileContent() throws IOException {
        String indexTemplate = IOUtils
                .toString(getClass().getResourceAsStream(INDEX_TS), UTF_8);
        String relativizedImport = ensureValidRelativePath(
                FrontendUtils.getUnixRelativePath(outputDirectory.toPath(),
                        generatedImports.toPath()));

        relativizedImport = relativizedImport
                // replace `./frontend/` with `../target/frontend/`
                // so as it can be copied to `frontend` without changes.
                .replaceFirst("^./", "../" + outputDirectory.getName() + "/")
                // remove extension
                .replaceFirst("\\.(ts|js)$", "");

        return indexTemplate.replace("[to-be-generated-by-flow]",
                relativizedImport);
    }

      TaskGenerateIndexTs(File frontendDirectory, File generatedImports,
            File outputDirectory);

}