Search in sources :

Example 1 with OnlineDetectFontLocator

use of com.synopsys.integration.detect.workflow.blackduck.font.OnlineDetectFontLocator in project synopsys-detect by blackducksoftware.

the class DetectFontLoaderFactory method detectFontLoader.

public DetectFontLoader detectFontLoader() {
    DetectFontLocator locator;
    Optional<File> fontAirGapPath = airGapInspectorPaths.getFontsAirGapDirectory();
    if (fontAirGapPath.isPresent()) {
        locator = new AirGapFontLocator(airGapInspectorPaths);
    } else {
        locator = new OnlineDetectFontLocator(new DetectFontInstaller(artifactResolver, installedToolManager, installedToolLocator), directoryManager);
    }
    return new DetectFontLoader(locator);
}
Also used : DetectFontLoader(com.synopsys.integration.detect.workflow.blackduck.DetectFontLoader) DetectFontInstaller(com.synopsys.integration.detect.workflow.blackduck.font.DetectFontInstaller) OnlineDetectFontLocator(com.synopsys.integration.detect.workflow.blackduck.font.OnlineDetectFontLocator) AirGapFontLocator(com.synopsys.integration.detect.workflow.blackduck.font.AirGapFontLocator) DetectFontLocator(com.synopsys.integration.detect.workflow.blackduck.font.DetectFontLocator) OnlineDetectFontLocator(com.synopsys.integration.detect.workflow.blackduck.font.OnlineDetectFontLocator) File(java.io.File)

Example 2 with OnlineDetectFontLocator

use of com.synopsys.integration.detect.workflow.blackduck.font.OnlineDetectFontLocator in project synopsys-detect by blackducksoftware.

the class FontLoaderTestIT method createTempDirectory.

@BeforeEach
public void createTempDirectory() throws Exception {
    fontDirectory = Files.createTempDirectory("junit_test_font_loader").toFile();
    PropertyConfiguration propertyConfiguration = new PropertyConfiguration(Collections.emptyList());
    Gson gson = new Gson();
    DetectConfigurationFactory detectConfigurationFactory = new DetectConfigurationFactory(new DetectPropertyConfiguration(propertyConfiguration, new SimplePathResolver()), gson);
    ConnectionFactory connectionFactory = new ConnectionFactory(detectConfigurationFactory.createConnectionDetails());
    ArtifactResolver artifactResolver = new ArtifactResolver(connectionFactory, gson);
    InstalledToolManager installedToolManager = new InstalledToolManager();
    InstalledToolLocator installedToolLocator = new InstalledToolLocator(Paths.get(""), new Gson());
    DetectFontInstaller installer = new DetectFontInstaller(artifactResolver, installedToolManager, installedToolLocator);
    DirectoryOptions directoryOptions = new DirectoryOptions(null, null, null, null, fontDirectory.toPath(), null);
    DirectoryManager directoryManager = new DirectoryManager(directoryOptions, DetectRunId.createDefault());
    detectFontLocator = new OnlineDetectFontLocator(installer, directoryManager);
}
Also used : InstalledToolLocator(com.synopsys.integration.detect.tool.cache.InstalledToolLocator) DirectoryManager(com.synopsys.integration.detect.workflow.file.DirectoryManager) Gson(com.google.gson.Gson) SimplePathResolver(com.synopsys.integration.configuration.property.types.path.SimplePathResolver) ArtifactResolver(com.synopsys.integration.detect.workflow.ArtifactResolver) ConnectionFactory(com.synopsys.integration.detect.configuration.connection.ConnectionFactory) InstalledToolManager(com.synopsys.integration.detect.tool.cache.InstalledToolManager) DetectFontInstaller(com.synopsys.integration.detect.workflow.blackduck.font.DetectFontInstaller) DirectoryOptions(com.synopsys.integration.detect.workflow.file.DirectoryOptions) DetectPropertyConfiguration(com.synopsys.integration.detect.configuration.DetectPropertyConfiguration) DetectConfigurationFactory(com.synopsys.integration.detect.configuration.DetectConfigurationFactory) OnlineDetectFontLocator(com.synopsys.integration.detect.workflow.blackduck.font.OnlineDetectFontLocator) PropertyConfiguration(com.synopsys.integration.configuration.config.PropertyConfiguration) DetectPropertyConfiguration(com.synopsys.integration.detect.configuration.DetectPropertyConfiguration) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

DetectFontInstaller (com.synopsys.integration.detect.workflow.blackduck.font.DetectFontInstaller)2 OnlineDetectFontLocator (com.synopsys.integration.detect.workflow.blackduck.font.OnlineDetectFontLocator)2 Gson (com.google.gson.Gson)1 PropertyConfiguration (com.synopsys.integration.configuration.config.PropertyConfiguration)1 SimplePathResolver (com.synopsys.integration.configuration.property.types.path.SimplePathResolver)1 DetectConfigurationFactory (com.synopsys.integration.detect.configuration.DetectConfigurationFactory)1 DetectPropertyConfiguration (com.synopsys.integration.detect.configuration.DetectPropertyConfiguration)1 ConnectionFactory (com.synopsys.integration.detect.configuration.connection.ConnectionFactory)1 InstalledToolLocator (com.synopsys.integration.detect.tool.cache.InstalledToolLocator)1 InstalledToolManager (com.synopsys.integration.detect.tool.cache.InstalledToolManager)1 ArtifactResolver (com.synopsys.integration.detect.workflow.ArtifactResolver)1 DetectFontLoader (com.synopsys.integration.detect.workflow.blackduck.DetectFontLoader)1 AirGapFontLocator (com.synopsys.integration.detect.workflow.blackduck.font.AirGapFontLocator)1 DetectFontLocator (com.synopsys.integration.detect.workflow.blackduck.font.DetectFontLocator)1 DirectoryManager (com.synopsys.integration.detect.workflow.file.DirectoryManager)1 DirectoryOptions (com.synopsys.integration.detect.workflow.file.DirectoryOptions)1 File (java.io.File)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1