Class CliUtils

  extended by com.sonyericsson.hudson.plugins.metadata.cli.CliUtils

public abstract class CliUtils
extends Object

Common utility functions for the CLI commands.

Robert Sandell <>

Nested Class Summary
static class CliUtils.NoItemException
          Exception thrown when the user has selected something that doesn't exist.
static class CliUtils.NoMetadataException
          Exception thrown when a user has selected something that doesn't have any metadata.
static class CliUtils.Status
          Status codes to be returned from the cli commands.
Method Summary
static MetadataContainer<MetadataValue> getContainer(String node, String job, Integer build, boolean createContainer)
          Finds the container that has been selected on the commandline.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail


public static MetadataContainer<MetadataValue> getContainer(String node,
                                                            String job,
                                                            Integer build,
                                                            boolean createContainer)
                                                     throws org.kohsuke.args4j.CmdLineException,
Finds the container that has been selected on the commandline.

node - the node parameter.
job - the job parameter
build - the build parameter
createContainer - create the container when it doesn't exist instead of failing, if the specified item doesn't exist it will still fail..
the container if one is found.
org.kohsuke.args4j.CmdLineException - if the combination of arguments are bad.
CliUtils.NoItemException - if the requested item (node, job or build) couldn't be found.
CliUtils.NoMetadataException - if the item doesn't contain any metadata.
IOException - if a metadata container needed to be added and it failed to do so.

Copyright © 2004-2013. All Rights Reserved.