Search in sources :

Example 1 with VersionSoftPolicy

use of org.fagu.fmv.soft.find.policy.VersionSoftPolicy in project fmv by f-agu.

the class SoftTestCase method testGS.

@Test
@Ignore
public void testGS() throws Exception {
    GSSoftProvider gsSoftProvider = new GSSoftProvider();
    Soft soft = gsSoftProvider.searchConfigurable(ss -> {
        ss.withPolicy(new VersionSoftPolicy().onAllPlatforms(maxVersion(new Version(8))));
    });
    soft.getFounds().forEach(sf -> {
        System.out.println(sf.getFoundReason() + "  " + sf.getFile() + "  " + sf.getReason());
    });
    SoftLogger softLogger = new SoftLogger(Collections.singletonList(soft));
    softLogger.log(System.out::println);
// System.out.println(soft);
}
Also used : VersionSoftPolicy(org.fagu.fmv.soft.find.policy.VersionSoftPolicy) GSSoftProvider(org.fagu.fmv.soft.gs.GSSoftProvider) VersionSoftPolicy.maxVersion(org.fagu.fmv.soft.find.policy.VersionSoftPolicy.maxVersion) Version(org.fagu.version.Version) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 2 with VersionSoftPolicy

use of org.fagu.fmv.soft.find.policy.VersionSoftPolicy in project fmv by f-agu.

the class PdfSoftProvider method getDefaultSoftPolicy.

// ***********************************************************************
/**
 * @return
 */
private static SoftPolicy getDefaultSoftPolicy() {
    Version v012 = new Version(0, 12);
    BiPredicate<SoftInfo, Provider> isProvider = (s, p) -> s instanceof XPdfVersionSoftInfo && ((XPdfVersionSoftInfo) s).getProvider() == p;
    return new VersionSoftPolicy().on("xpdf", s -> isProvider.test(s, Provider.XPDF), minVersion(Version.V3)).on("poppler", s -> isProvider.test(s, Provider.POPPLER), minVersion(v012)).onAllPlatforms(minVersion(v012));
}
Also used : Arrays(java.util.Arrays) VersionParserManager(org.fagu.version.VersionParserManager) SoftFound(org.fagu.fmv.soft.find.SoftFound) ProgramFilesLocatorSupplier(org.fagu.fmv.soft.win32.ProgramFilesLocatorSupplier) ArrayList(java.util.ArrayList) SoftProvider(org.fagu.fmv.soft.find.SoftProvider) BiPredicate(java.util.function.BiPredicate) Matcher(java.util.regex.Matcher) VersionSoftPolicy(org.fagu.fmv.soft.find.policy.VersionSoftPolicy) ObjectUtils(org.apache.commons.lang3.ObjectUtils) ExceptionKnownAnalyzer(org.fagu.fmv.soft.exec.exception.ExceptionKnownAnalyzer) XpdfExceptionKnownAnalyzer(org.fagu.fmv.soft.xpdf.exception.XpdfExceptionKnownAnalyzer) Soft(org.fagu.fmv.soft.Soft) SoftFoundFactory(org.fagu.fmv.soft.find.SoftFoundFactory) SoftLocator(org.fagu.fmv.soft.find.SoftLocator) SoftPolicy(org.fagu.fmv.soft.find.SoftPolicy) SystemUtils(org.apache.commons.lang3.SystemUtils) SoftInfo(org.fagu.fmv.soft.find.SoftInfo) IOException(java.io.IOException) Collectors(java.util.stream.Collectors) File(java.io.File) StandardCharsets(java.nio.charset.StandardCharsets) VersionSoftPolicy.minVersion(org.fagu.fmv.soft.find.policy.VersionSoftPolicy.minVersion) List(java.util.List) Parser(org.fagu.fmv.soft.find.ExecSoftFoundFactory.Parser) Pattern(java.util.regex.Pattern) Version(org.fagu.version.Version) Collections(java.util.Collections) SoftExecutor(org.fagu.fmv.soft.SoftExecutor) SoftInfo(org.fagu.fmv.soft.find.SoftInfo) VersionSoftPolicy(org.fagu.fmv.soft.find.policy.VersionSoftPolicy) VersionSoftPolicy.minVersion(org.fagu.fmv.soft.find.policy.VersionSoftPolicy.minVersion) Version(org.fagu.version.Version) SoftProvider(org.fagu.fmv.soft.find.SoftProvider)

Aggregations

VersionSoftPolicy (org.fagu.fmv.soft.find.policy.VersionSoftPolicy)2 Version (org.fagu.version.Version)2 File (java.io.File)1 IOException (java.io.IOException)1 StandardCharsets (java.nio.charset.StandardCharsets)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1 List (java.util.List)1 BiPredicate (java.util.function.BiPredicate)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 Collectors (java.util.stream.Collectors)1 ObjectUtils (org.apache.commons.lang3.ObjectUtils)1 SystemUtils (org.apache.commons.lang3.SystemUtils)1 Soft (org.fagu.fmv.soft.Soft)1 SoftExecutor (org.fagu.fmv.soft.SoftExecutor)1 ExceptionKnownAnalyzer (org.fagu.fmv.soft.exec.exception.ExceptionKnownAnalyzer)1 Parser (org.fagu.fmv.soft.find.ExecSoftFoundFactory.Parser)1 SoftFound (org.fagu.fmv.soft.find.SoftFound)1