Class EnvironmentUtils


  • public final class EnvironmentUtils
    extends Object
    Various utilities dealing with environment properties.
    Author:
    David M. Lloyd
    • Method Detail

      • getSecurityCredentials

        public static org.wildfly.security.auth.server.IdentityCredentials getSecurityCredentials​(Map<String,​?> env)
        Get the security credential, if any. If an entry is present but not recognized, an empty credential set is returned.
        Parameters:
        env - the environment (must not be null)
        Returns:
        the security credentials, or null if none was present
      • getSecurityCredentials

        public static org.wildfly.security.auth.server.IdentityCredentials getSecurityCredentials​(Map<String,​?> env,
                                                                                                  String propertyName)
        Get the security credential, if any. If an entry is present but not recognized, an empty credential set is returned.
        Parameters:
        env - the environment (must not be null)
        propertyName - the property name (must not be null)
        Returns:
        the security credentials, or null if none was present
      • getSecurityRealmName

        public static String getSecurityRealmName​(Map<String,​?> env)
        Get the name of the security realm, if any.
        Returns:
        the name of the security realm, or null if there is none or it is in an unrecognized format
      • getURLPackagePrefixes

        public static List<String> getURLPackagePrefixes​(Map<String,​?> env)
        Get the URL package prefixes defined in the given property name. If no URL package prefixes are defined in the given property name, then the default list is returned. The returned list is mutable.
        Parameters:
        env - the environment (must not be null)
        Returns:
        the list of package prefixes
      • getURLPackagePrefixes

        public static List<String> getURLPackagePrefixes​(Map<String,​?> env,
                                                         String propertyName)
        Get the URL package prefixes defined in the given property name. If no URL package prefixes are defined in the given property name, then the default list is returned. The returned list is mutable.
        Parameters:
        env - the environment (must not be null)
        propertyName - the property name to search (must not be null)
        Returns:
        the list of package prefixes
      • compileURLPackagePrefixes

        public static String compileURLPackagePrefixes​(Collection<String> prefixes)
        Compile the given collection of URL package prefixes into a string.
        Parameters:
        prefixes - the package prefixes (must not be null)
        Returns:
        the string, or null if there are no package prefixes (i.e. the corresponding property can be removed)