Package hudson.util

Examples of hudson.util.VersionNumber


         */
        public boolean isCompatibleWithInstalledVersion() {
            PluginWrapper installedVersion = getInstalled();
            if (installedVersion != null) {
                if (compatibleSinceVersion != null) {
                    if (new VersionNumber(installedVersion.getVersion())
                            .isOlderThan(new VersionNumber(compatibleSinceVersion))) {
                        return false;
                    }
                }
            }
            return true;
View Full Code Here


        public List<Plugin> getNeededDependencies() {
            List<Plugin> deps = new ArrayList<Plugin>();

            for(Map.Entry<String,String> e : dependencies.entrySet()) {
                Plugin depPlugin = Hudson.getInstance().getUpdateCenter().getPlugin(e.getKey());
                VersionNumber requiredVersion = new VersionNumber(e.getValue());
               
                // Is the plugin installed already? If not, add it.
                PluginWrapper current = depPlugin.getInstalled();

                if (current ==null) {
View Full Code Here

            return deps;
        }
       
        public boolean isForNewerHudson() {
            try {
                return requiredCore!=null && new VersionNumber(requiredCore).isNewerThan(
                  new VersionNumber(Hudson.VERSION.replaceFirst("SHOT *\\(private.*\\)", "SHOT")));
            } catch (NumberFormatException nfe) {
                return true// If unable to parse version
            }
        }
View Full Code Here

     *
     * @since 1.301
     */
    public boolean isUpgradedFromBefore(VersionNumber v) {
        try {
            return new VersionNumber(version).isOlderThan(v);
        } catch (IllegalArgumentException e) {
            // fail to parse this version number
            return false;
        }
    }
View Full Code Here

     * Parses {@link #VERSION} into {@link VersionNumber}, or null if it's not parseable as a version number
     * (such as when Hudson is run with "mvn hudson-dev:run")
     */
    public static VersionNumber getVersion() {
        try {
            return new VersionNumber(VERSION);
        } catch (NumberFormatException e) {
            try {
                // for non-released version of Hudson, this looks like "1.345 (private-foobar), so try to approximate.
                int idx = VERSION.indexOf(' ');
                if (idx > 0) {
                    return new VersionNumber(VERSION.substring(0, idx));
                }
            } catch (NumberFormatException _) {
                // fall through
            }

View Full Code Here

     * to remain backward compatible.
     * @param grantedPermissions
     */
    /*package*/ static boolean migrateHudson2324(Map<Permission,Set<String>> grantedPermissions) {
        boolean result = false;
        if(Hudson.getInstance().isUpgradedFromBefore(new VersionNumber("1.300.*"))) {
            Set<String> f = grantedPermissions.get(Hudson.READ);
            if (f!=null) {
                Set<String> t = grantedPermissions.get(Item.READ);
                if (t!=null)
                    result = t.addAll(f);
View Full Code Here

TOP

Related Classes of hudson.util.VersionNumber

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.