Class JiraUtils

java.lang.Object
com.atlassian.jira.util.JiraUtils

public final class JiraUtils extends Object
Miscellaneous utility methods. Most have moved into more specific classes.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    get24HourTime(String meridianIndicator, int hours)
    Calculate meridian adjustment add 12 hours if meridian is set to PM - note 12pm is 12:00 in 24 hour time.
    static String
    Returns the server ip where the vm is running.
    static boolean
    Returns true if JIRA is really running in public mode.
    static boolean
    Deprecated.
    The casing of this method is misleading; use isSetUp() instead.
    static boolean
    Indicates whether JIRA has been set up.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • JiraUtils

      public JiraUtils()
  • Method Details

    • isPublicMode

      public static boolean isPublicMode()
      Returns true if JIRA is really running in public mode.

      That is, JIRA Mode is enabled AND there is at least one writable User Directory.

      JRA-15966 Public mode should only be allowed if External User Management is disabled, otherwise we cannot create a new user in JIRA. Older versions of JIRA would allow the admin to set up an invalid combination of both External User Management and Public Mode enabled, and so we need to account for this possibility.

      Returns:
      true if we allow public signup in this JIRA instance.
    • get24HourTime

      public static int get24HourTime(String meridianIndicator, int hours)
      Calculate meridian adjustment add 12 hours if meridian is set to PM - note 12pm is 12:00 in 24 hour time.
      Parameters:
      meridianIndicator - am or pm
      hours - 1-12
      Returns:
      1-24
    • isSetUp

      public static boolean isSetUp()
      Indicates whether JIRA has been set up.
      Returns:
      see above
      Since:
      7.4
    • isSetup

      @Deprecated public static boolean isSetup()
      Deprecated.
      The casing of this method is misleading; use isSetUp() instead. Since v7.4.
      Indicates whether JIRA has been set up.
      Returns:
      see above
    • getHostname

      public static String getHostname()
      Returns the server ip where the vm is running.
      Returns:
      the ip or if error 0.0.0.0