Class UrlUtil


  • public class UrlUtil
    extends java.lang.Object
    Alfresco URL related utility functions.
    Since:
    3.5
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.regex.Pattern PATTERN  
    • Constructor Summary

      Constructors 
      Constructor Description
      UrlUtil()  
    • Field Detail

      • PATTERN

        public static final java.util.regex.Pattern PATTERN
    • Constructor Detail

      • UrlUtil

        public UrlUtil()
    • Method Detail

      • getAlfrescoUrl

        public static java.lang.String getAlfrescoUrl​(SysAdminParams sysAdminParams)
        Builds up the Url to Alfresco based on the settings in the SysAdminParams.
        Returns:
        Alfresco Url such as https://col.ab.or.ate/alfresco/ or http://localhost:8080/alfresco/
      • getShareUrl

        public static java.lang.String getShareUrl​(SysAdminParams sysAdminParams)
        Builds up the Url to Share based on the settings in the SysAdminParams.
        Returns:
        Alfresco Url such as https://col.ab.or.ate/share/ or http://localhost:8081/share/
      • getApiExplorerUrl

        public static java.lang.String getApiExplorerUrl​(SysAdminParams sysAdminParams)
      • getApiExplorerUrl

        public static java.lang.String getApiExplorerUrl​(SysAdminParams sysAdminParams,
                                                         java.lang.String requestURL,
                                                         java.lang.String requestURI)
        Builds URL to Api-Explorer based on the request only if the URL property is not provided SysAdminParams.
        Returns:
        Rest-Api Url such as https://col.ab.or.ate/api-explorer/ or http://localhost:8082/api-explorer/
      • replaceShareUrlPlaceholder

        public static java.lang.String replaceShareUrlPlaceholder​(java.lang.String value,
                                                                  SysAdminParams sysAdminParams)
        Replaces the share url placeholder, namely ${shareUrl}, with share url.
        Parameters:
        value - the string value which contains the share url placeholder
        sysAdminParams - the SysAdminParams object
        Returns:
        if the given value contains share url placeholder, the placeholder is replaced with share url; otherwise, the given value is simply returned
      • buildUrl

        protected static java.lang.String buildUrl​(java.lang.String protocol,
                                                   java.lang.String host,
                                                   int port,
                                                   java.lang.String context)