Search in sources :

Example 6 with SoftLocator

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

the class SoftSearch method search.

/**
 * @param softTester
 * @return
 */
public Soft search(SoftTester softTester) {
    checkUsed();
    SoftLocator locator = getLocator();
    Founds founds = locator.find(softTester);
    return createAndfireEventFound(founds, locator);
}
Also used : SoftLocator(org.fagu.fmv.soft.find.SoftLocator) Founds(org.fagu.fmv.soft.find.Founds)

Example 7 with SoftLocator

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

the class GSSoftProvider method getSoftLocator.

/**
 * @see org.fagu.fmv.soft.find.SoftProvider#getSoftLocator()
 */
@Override
public SoftLocator getSoftLocator() {
    SoftLocator softLocator = super.getSoftLocator();
    if (SystemUtils.IS_OS_WINDOWS) {
        ProgramFilesLocatorSupplier.with(softLocator).find(programFile -> {
            File folder = new File(programFile, "gs");
            if (!folder.exists()) {
                return Collections.emptyList();
            }
            File[] listFiles = folder.listFiles(f -> f.getName().startsWith("gs"));
            return listFiles != null && listFiles.length > 0 ? Arrays.asList(listFiles).stream().map(f -> new File(f, "bin")).collect(Collectors.toList()) : Collections.emptyList();
        }).supplyIn();
        softLocator.addDefaultLocator();
    }
    return softLocator;
}
Also used : SoftFoundFactory(org.fagu.fmv.soft.find.SoftFoundFactory) SoftLocator(org.fagu.fmv.soft.find.SoftLocator) Arrays(java.util.Arrays) VersionParserManager(org.fagu.version.VersionParserManager) SoftPolicy(org.fagu.fmv.soft.find.SoftPolicy) Date(java.util.Date) SystemUtils(org.apache.commons.lang3.SystemUtils) SimpleDateFormat(java.text.SimpleDateFormat) GSExceptionKnownAnalyzer(org.fagu.fmv.soft.gs.exception.GSExceptionKnownAnalyzer) ProgramFilesLocatorSupplier(org.fagu.fmv.soft.win32.ProgramFilesLocatorSupplier) Collectors(java.util.stream.Collectors) File(java.io.File) VersionDate(org.fagu.fmv.soft.find.ExecSoftFoundFactory.VersionDate) SoftProvider(org.fagu.fmv.soft.find.SoftProvider) VersionSoftPolicy.minVersion(org.fagu.fmv.soft.find.policy.VersionSoftPolicy.minVersion) FileFilter(java.io.FileFilter) Matcher(java.util.regex.Matcher) VersionSoftPolicy(org.fagu.fmv.soft.find.policy.VersionSoftPolicy) ObjectUtils(org.apache.commons.lang3.ObjectUtils) Pattern(java.util.regex.Pattern) Version(org.fagu.version.Version) ExceptionKnownAnalyzer(org.fagu.fmv.soft.exec.exception.ExceptionKnownAnalyzer) Collections(java.util.Collections) FilenameUtils(org.apache.commons.io.FilenameUtils) SoftLocator(org.fagu.fmv.soft.find.SoftLocator) File(java.io.File)

Example 8 with SoftLocator

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

the class MediaInfoSoftProvider method getSoftLocator.

/**
 * @see org.fagu.fmv.soft.find.SoftProvider#getSoftLocator()
 */
@Override
public SoftLocator getSoftLocator() {
    SoftLocator softLocator = super.getSoftLocator();
    if (SystemUtils.IS_OS_WINDOWS) {
        ProgramFilesLocatorSupplier.with(softLocator).findFolder("MediaInfo").supplyIn();
        softLocator.addDefaultLocator();
    }
    return softLocator;
}
Also used : SoftLocator(org.fagu.fmv.soft.find.SoftLocator)

Example 9 with SoftLocator

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

the class MSoftProvider method getSoftLocator.

/**
 * @see org.fagu.fmv.soft.find.SoftProvider#getSoftLocator()
 */
@Override
public SoftLocator getSoftLocator() {
    SoftLocator softLocator = super.getSoftLocator();
    if (SystemUtils.IS_OS_WINDOWS) {
        ProgramFilesLocatorSupplier.with(softLocator).find(programFile -> {
            File[] mFolders = programFile.listFiles(f -> f.getName().toLowerCase().startsWith("mplayer"));
            return mFolders != null ? Arrays.asList(mFolders) : Collections.emptyList();
        }).supplyIn();
        softLocator.addDefaultLocator();
    }
    return softLocator;
}
Also used : SoftFoundFactory(org.fagu.fmv.soft.find.SoftFoundFactory) SoftLocator(org.fagu.fmv.soft.find.SoftLocator) Arrays(java.util.Arrays) VersionParserManager(org.fagu.version.VersionParserManager) SoftPolicy(org.fagu.fmv.soft.find.SoftPolicy) SystemUtils(org.apache.commons.lang3.SystemUtils) ProgramFilesLocatorSupplier(org.fagu.fmv.soft.win32.ProgramFilesLocatorSupplier) File(java.io.File) SoftProvider(org.fagu.fmv.soft.find.SoftProvider) VersionSoftPolicy.minVersion(org.fagu.fmv.soft.find.policy.VersionSoftPolicy.minVersion) Matcher(java.util.regex.Matcher) VersionSoftPolicy(org.fagu.fmv.soft.find.policy.VersionSoftPolicy) Pattern(java.util.regex.Pattern) Collections(java.util.Collections) SoftLocator(org.fagu.fmv.soft.find.SoftLocator)

Example 10 with SoftLocator

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

the class VLCSoftProvider method getSoftLocator.

/**
 * @see org.fagu.fmv.soft.find.SoftProvider#getSoftLocator()
 */
@Override
public SoftLocator getSoftLocator() {
    SoftLocator softLocator = super.getSoftLocator();
    if (SystemUtils.IS_OS_WINDOWS) {
        ProgramFilesLocatorSupplier.with(softLocator).findFolder("VideoLAN" + File.separator + "VLC").supplyIn();
        softLocator.addDefaultLocator();
    }
    return softLocator;
}
Also used : SoftLocator(org.fagu.fmv.soft.find.SoftLocator)

Aggregations

SoftLocator (org.fagu.fmv.soft.find.SoftLocator)12 File (java.io.File)6 Matcher (java.util.regex.Matcher)6 Pattern (java.util.regex.Pattern)6 SystemUtils (org.apache.commons.lang3.SystemUtils)6 SoftFoundFactory (org.fagu.fmv.soft.find.SoftFoundFactory)6 SoftProvider (org.fagu.fmv.soft.find.SoftProvider)6 ProgramFilesLocatorSupplier (org.fagu.fmv.soft.win32.ProgramFilesLocatorSupplier)6 VersionParserManager (org.fagu.version.VersionParserManager)6 SoftPolicy (org.fagu.fmv.soft.find.SoftPolicy)5 VersionSoftPolicy (org.fagu.fmv.soft.find.policy.VersionSoftPolicy)5 VersionSoftPolicy.minVersion (org.fagu.fmv.soft.find.policy.VersionSoftPolicy.minVersion)5 ArrayList (java.util.ArrayList)4 List (java.util.List)4 ObjectUtils (org.apache.commons.lang3.ObjectUtils)4 ExceptionKnownAnalyzer (org.fagu.fmv.soft.exec.exception.ExceptionKnownAnalyzer)4 Version (org.fagu.version.Version)4 IOException (java.io.IOException)3 SimpleDateFormat (java.text.SimpleDateFormat)3 Arrays (java.util.Arrays)3