com.sonyericsson.hudson.plugins.gerrit.trigger.utils
Class StringUtil

java.lang.Object
  extended by com.sonyericsson.hudson.plugins.gerrit.trigger.utils.StringUtil

public final class StringUtil
extends Object

Various string making utility methods.

Author:
Robert Sandell <robert.sandell@sonyericsson.com>

Field Summary
static String PLUGIN_IMAGES_URL
          The base URL of the plugin images.
static String PLUGIN_JS_URL
          The base URL of the plugin javascripts.
static String PLUGIN_URL
          The base URL of this plugin.
static String REFSPEC_PREFIX
          What comes before the change and patch numbers in a refspec.
 
Method Summary
static String escapeQuotes(String value)
          Escape quotes in String value.
static String getPluginImageUrl(String imageName)
          Gets the path to the provided image inside this plugin.
static String getPluginJsUrl(String jsName)
          Gets the path to the provided javascript file inside this plugin.
static String makeRefSpec(com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event)
          Creates a refspec string from the data in the event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REFSPEC_PREFIX

public static final String REFSPEC_PREFIX
What comes before the change and patch numbers in a refspec.

See Also:
Constant Field Values

PLUGIN_URL

public static final String PLUGIN_URL
The base URL of this plugin.

See Also:
Constant Field Values

PLUGIN_IMAGES_URL

public static final String PLUGIN_IMAGES_URL
The base URL of the plugin images.

See Also:
Constant Field Values

PLUGIN_JS_URL

public static final String PLUGIN_JS_URL
The base URL of the plugin javascripts.

See Also:
Constant Field Values
Method Detail

makeRefSpec

public static String makeRefSpec(com.sonymobile.tools.gerrit.gerritevents.dto.events.ChangeBasedEvent event)
Creates a refspec string from the data in the event. Unless the patch-set already has a refspec specified. For a change with number 3456 and patchset 1 the refspec would be refs/changes/56/3456/1

Parameters:
event - the event.
Returns:
the refspec.
See Also:
ChangeBasedEvent.getPatchSet(), PatchSet.getRef()

getPluginImageUrl

public static String getPluginImageUrl(String imageName)
Gets the path to the provided image inside this plugin. The path returned is "compliant" with what for example Action.getIconFileName() expects.

Parameters:
imageName - the fileName of the image.
Returns:
the full path to the image.
See Also:
PLUGIN_IMAGES_URL

getPluginJsUrl

public static String getPluginJsUrl(String jsName)
Gets the path to the provided javascript file inside this plugin.

Parameters:
jsName - the name if the javascript.
Returns:
the full path to the file.
See Also:
PLUGIN_JS_URL

escapeQuotes

public static String escapeQuotes(String value)
Escape quotes in String value.

Parameters:
value - the name of String object having quotes.
Returns:
String object as the result of escape quotes in input.


Copyright © 2004-2014. All Rights Reserved.