Java 类cpw.mods.fml.common.versioning.ComparableVersion 实例源码

项目:4Space-5    文件:DepLoader.java   
public VersionedFile(String filename, Pattern pattern)
{
    this.pattern = pattern;
    this.filename = filename;
    Matcher m = pattern.matcher(filename);
    if (m.matches())
    {
        name = m.group(1);
        version = new ComparableVersion(m.group(2));
    }
    else
    {
        name = null;
        version = null;
    }
}
项目:4Space-5    文件:CCUpdateChecker.java   
public static void updateCheck(final String mod, final String version) {
    updateCheck("http://www.chickenbones.net/Files/notification/version.php?" +
            "version=" + mcVersion() + "&" +
            "file=" + mod,
            new Function<String, Void>()
            {
                @Override public Void apply(String ret) {
                    if (!ret.startsWith("Ret: ")) {
                        CodeChickenCorePlugin.logger.error("Failed to check update for " + mod + " returned: " + ret);
                        return null;
                    }
                    ComparableVersion newversion = new ComparableVersion(ret.substring(5));
                    if (newversion.compareTo(new ComparableVersion(version)) > 0)
                        addUpdateMessage("Version " + newversion + " of " + mod + " is available");
                    return null;
                }
            });
}
项目:InventoryTools    文件:DepLoader.java   
public VersionedFile(String filename, Pattern pattern)
{
    this.pattern = pattern;
    this.filename = filename;
    Matcher m = pattern.matcher(filename);
    if (m.matches())
    {
        name = m.group(1);
        version = new ComparableVersion(m.group(2));
    }
    else
    {
        name = null;
        version = null;
    }
}
项目:4Space-5    文件:DepLoader.java   
public VersionedFile(String filename, Pattern pattern) {
    this.pattern = pattern;
    this.filename = filename;
    Matcher m = pattern.matcher(filename);
    if(m.matches()) {
        name = m.group(1);
        version = new ComparableVersion(m.group(2));
    }
    else {
        name = null;
        version = null;
    }
}
项目:vsminecraft    文件:DepLoader.java   
public VersionedFile(String filename, Pattern pattern) {
    this.pattern = pattern;
    this.filename = filename;
    Matcher m = pattern.matcher(filename);
    if(m.matches()) {
        name = m.group(1);
        version = new ComparableVersion(m.group(2));
    }
    else {
        name = null;
        version = null;
    }
}
项目:MyEssentials-Core    文件:VersionedFile.java   
public VersionedFile(String filename, Pattern pattern) {
    this.pattern = pattern;
    this.filename = filename;
    Matcher m = pattern.matcher(filename);
    if(m.matches()) {
        name = m.group(1);
        version = new ComparableVersion(m.group(2));
    }
    else {
        name = null;
        version = null;
    }
}
项目:Nucleum-Omnium    文件:VersionChecker.java   
private void check(ModContainer modContainer)
{
    try
    {
        ComparableVersion current = new ComparableVersion(modContainer.getVersion());
        URL url = new URL(NOConstants.URL_MAVEN + modContainer.getMod().getClass().getCanonicalName().replace('.', '/') + "/maven-metadata.xml");
        MetadataXpp3Reader metadataXpp3Reader = new MetadataXpp3Reader();
        Metadata metadata = metadataXpp3Reader.read(url.openStream());

        ComparableVersion latest = null;
        for (String versionString : metadata.getVersioning().getVersions())
        {
            if (versionString.contains(MCVERSION + "-"))
            {
                versionString = versionString.replace(MCVERSION + "-", "");
                ComparableVersion version = new ComparableVersion(versionString);
                if (latest == null || version.compareTo(latest) > 0) latest = version;
            }
        }

        if (latest != null && latest.compareTo(current) > 0) modsToUpdate.put(modContainer, latest.toString());
    }
    catch (Exception ignored)
    {
        // We don't really care, a lot of things can go wrong...
        NucleumOmnium.getLogger().info("Something went wrong when version checking " + modContainer.getModId() + ", check manually.");
    }
}
项目:libsandstone    文件:DataSender.java   
private boolean checkIsNewer(String current, String received) {
    return new ComparableVersion(received).compareTo(new ComparableVersion(current)) > 0;
}
项目:MyEssentials-Core    文件:Dependency.java   
public ComparableVersion getVersion() {
    return file.getVersion();
}
项目:MyEssentials-Core    文件:VersionedFile.java   
public ComparableVersion getVersion() {
    return version;
}