io.qameta.allure.plugin.DefaultPlugin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of allure-generator Show documentation
Show all versions of allure-generator Show documentation
Module allure-generator of Allure Framework.
package io.qameta.allure.plugin;
import io.qameta.allure.Extension;
import io.qameta.allure.PluginConfiguration;
import io.qameta.allure.core.Plugin;
import io.qameta.allure.util.CopyVisitor;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
import java.util.List;
/**
* Default plugin implementation that unpack files from directory.
*
* @since 2.0
*/
public class DefaultPlugin implements Plugin {
private final PluginConfiguration configuration;
private final List extensions;
private final Path pluginDirectory;
public DefaultPlugin(final PluginConfiguration configuration,
final List extensions,
final Path pluginDirectory) {
this.configuration = configuration;
this.extensions = extensions;
this.pluginDirectory = pluginDirectory;
}
@Override
public PluginConfiguration getConfig() {
return configuration;
}
@Override
public void unpackReportStatic(final Path outputDirectory) throws IOException {
final Path pluginStatic = pluginDirectory.resolve("static");
if (Files.exists(pluginStatic)) {
Files.walkFileTree(pluginStatic, new CopyVisitor(pluginStatic, outputDirectory));
}
}
@Override
public List getExtensions() {
return Collections.unmodifiableList(extensions);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy