Search in sources :

Example 1 with VersionParseException

use of org.fagu.version.VersionParseException in project fmv by f-agu.

the class FFSoftProvider method getVersion.

/**
 * @param line
 * @return
 */
static Version getVersion(String line) {
    String sver = StringUtils.substringBefore(line, " ");
    Matcher matcher = NVERSION_PATTERN.matcher(sver);
    if (matcher.matches()) {
        sver = matcher.group(1);
    }
    try {
        return VersionParserManager.parse(sver);
    } catch (VersionParseException e) {
    // ignore
    }
    return null;
}
Also used : Matcher(java.util.regex.Matcher) VersionParseException(org.fagu.version.VersionParseException)

Example 2 with VersionParseException

use of org.fagu.version.VersionParseException in project fmv by f-agu.

the class FFSoftProvider method addLibVersions.

/**
 * @param map
 * @param matcher
 */
static void addLibVersions(Map<String, Version> map, Matcher matcher) {
    String sver = matcher.group(2).replaceAll(" ", "");
    try {
        Version version = VersionParserManager.parse(sver);
        map.put(matcher.group(1), version);
    } catch (VersionParseException e) {
    // ignore
    }
}
Also used : Version(org.fagu.version.Version) VersionParseException(org.fagu.version.VersionParseException)

Aggregations

VersionParseException (org.fagu.version.VersionParseException)2 Matcher (java.util.regex.Matcher)1 Version (org.fagu.version.Version)1