com.atlassian.jira.util
Class JiraKeyUtils

java.lang.Object
  extended bycom.atlassian.jira.util.JiraKeyUtils

public class JiraKeyUtils
extends Object


Field Summary
static boolean IGNORE_URL_WITH_KEY
           
static String ISSUEKEY_REGEX
           
 
Constructor Summary
JiraKeyUtils()
           
 
Method Summary
static boolean canCurrentUserSeeIssue(org.ofbiz.core.entity.GenericValue issue)
           
static long getCountFromKey(String key)
           
static long getFastCountFromKey(String key)
          Same as getCountFromKey(String) except that is does not check for key validity
static String getFastProjectKeyFromIssueKey(String key)
          Same as getProjectKeyFromIssueKey(String) except that it does not check key validity
static List getIssueKeysFromString(String body)
           
static String getProjectKeyFromIssueKey(String key)
           
static boolean isKeyInString(String s)
          Determines whether any JIRA issue key is in the given string
static boolean isKeyInString(String issueKey, String body)
          Determines whether the provided key is part of the provided string
static boolean isPartOfUrl(String body, int start)
           
static boolean isReservedKeyword(String key)
          Check if the Project Key matches a list of reserved keywords - JRA-8051.
static String linkBugKeys(String body)
           
static boolean validIssueKey(String key)
           
static boolean validProjectKey(String key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ISSUEKEY_REGEX

public static String ISSUEKEY_REGEX

IGNORE_URL_WITH_KEY

public static boolean IGNORE_URL_WITH_KEY
Constructor Detail

JiraKeyUtils

public JiraKeyUtils()
Method Detail

validProjectKey

public static boolean validProjectKey(String key)
Returns:
True if the supplied project key is valid

isReservedKeyword

public static boolean isReservedKeyword(String key)
Check if the Project Key matches a list of reserved keywords - JRA-8051. For example, a folder named 'CON' cannot be created in WINDOWS as it is a reserved word. This check is only enabled for WINDOWS machines at present as this issue has only been reported in the WINDOWS environment.

Parameters:
key -
Returns:

getProjectKeyFromIssueKey

public static String getProjectKeyFromIssueKey(String key)
Returns:
The project key from an issue key, or null if the key is invalid

getFastProjectKeyFromIssueKey

public static String getFastProjectKeyFromIssueKey(String key)
Same as getProjectKeyFromIssueKey(String) except that it does not check key validity

Returns:
The project key from an issue key, or null if the key is invalid

getFastCountFromKey

public static long getFastCountFromKey(String key)
Same as getCountFromKey(String) except that is does not check for key validity

Returns:
The issue count from an issue key, or -1 if the key is invalid

getCountFromKey

public static long getCountFromKey(String key)
Returns:
The issue count from an issue key, or -1 if the key is invalid

validIssueKey

public static boolean validIssueKey(String key)
Returns:
True if the supplied issue key starts with a valid project key, and ends with a number

isKeyInString

public static boolean isKeyInString(String issueKey,
                                    String body)
Determines whether the provided key is part of the provided string

Parameters:
issueKey -
body -

isKeyInString

public static boolean isKeyInString(String s)
Determines whether any JIRA issue key is in the given string

Parameters:
s - string to check
Returns:
true if a key was found, false otherwise

canCurrentUserSeeIssue

public static boolean canCurrentUserSeeIssue(org.ofbiz.core.entity.GenericValue issue)

linkBugKeys

public static String linkBugKeys(String body)

getIssueKeysFromString

public static List getIssueKeysFromString(String body)

isPartOfUrl

public static boolean isPartOfUrl(String body,
                                  int start)


Copyright © 2002-2006 Atlassian. All Rights Reserved.