:D /* * The MIT License * * Copyright (c) 2004-2009, Sun - TopicsExpress



          

:D /* * The MIT License * * Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Stephen Connolly * Copyright (C) 2009 Robert Collins * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the Software), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.jvnet.hudson.plugins.platformlabeler; import net.robertcollins.lsb.Release; import hudson.remoting.Callable; import java.util.HashSet; class PlatformDetailsTask implements Callable { /** Performs computation and returns the result, or throws some exception. */ public HashSet call() throws Exception { final String arch = System.getProperty(os.arch); String name = System.getProperty(os.name).toLowerCase(); String version = System.getProperty(os.version); if (name.equals(solaris) || name.equals(SunOS)) { name = solaris; } else if (name.startsWith(windows)) { name = windows; if (name.startsWith(windows 9)) { if (version.startsWith(4.0)) { version = 95; } else if (version.startsWith(4.9)) { version = me; } else { assert version.startsWith(4.1); version = 98; } } else { if (version.startsWith(4.0)) { version = nt4; } else if (version.startsWith(5.0)) { version = 2000; } else if (version.startsWith(5.1)) { version = xp; } else if (version.startsWith(5.2)) { version = 2003; } } } else if (name.startsWith(linux)) { Release release = new Release(); name = release.distributorId(); version = release.release(); } else if (name.startsWith(mac)) { name = mac; } else { // Take the System.properties values verbatim. } HashSet result = new HashSet(); result.add(arch); result.add(name); result.add(version); result.add(arch + - + name); result.add(name + - + version); result.add(arch + - + name + - + version); return result; } }
Posted on: Sun, 05 Oct 2014 04:04:46 +0000

Trending Topics



style="margin-left:0px; min-height:30px;"> Ai grija de Trup si Suflet! Atentia acordată aspectului exterior
JogBelfast South/Ormeau: Parking Information: Hi folks just a
NITV is in the field today at the home of the Newcastle Yowies for
#ADM "R.E.M. foi uma banda de rock norte-americana formada em
Festival Belliniano 2013 - Dal 2 Settembre al 3 Novembre N.B: I

Recently Viewed Topics




© 2015