Enum Class UrlMode

java.lang.Object
java.lang.Enum<UrlMode>
com.atlassian.webresource.api.UrlMode
All Implemented Interfaces:
Serializable, Comparable<UrlMode>, Constable

public enum UrlMode extends Enum<UrlMode>
A formatting mode for URLs. Used to specify to WebResourceManager methods whether to use absolute URLs, relative URLs, or allow the concrete implementation to decide
Since:
3.0
  • Enum Constant Details

    • ABSOLUTE

      public static final UrlMode ABSOLUTE
      Absolute URL format, with URL scheme, hostname, port (if non-standard for the scheme), and context path.
    • RELATIVE

      public static final UrlMode RELATIVE
      Relative URL format, starting with a slash and the context path.
    • AUTO

      public static final UrlMode AUTO
      Unspecified URL format, indicating that either absolute or relative URLs are acceptable. Implementations are free to determine which mode to use based on any criteria of their choosing. For example, an implementation may choose to return a relative URL if it detects that it is running in the context of an HTTP request, and an absolute URL if it detects that it is not. Or it may choose to always return an absolute URL, or always return a relative URL. Callers should only use UrlMode#AUTO when they are sure that either an absolute or a relative URL will be appropriate, and should not rely on any particular observed behavior regarding how this value is interpreted, which may vary across different implementations.
  • Method Details

    • values

      public static UrlMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static UrlMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null