Class WebLink

  • All Implemented Interfaces:
    Serializable

    public class WebLink
    extends SimpleValueObject<String>
    Value object which provides methods to handle a web link (aka URI or URL).

    Example:

    import ch.ivyteam.ivy.model.value.WebLink;

    WebLink link = new WebLink("http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi");
    link.getRelative(); // /Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi
    link.getRelativeEncoded(); // /Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=gr%C3%BCezi
    link.getAbsolute(); // http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi
    link.getAbsoluteEncoded(); // http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=gr%C3%BCezi

    Since:
    6.6.2
    See Also:
    Serialized Form
    API:
    This is a public API.
    • Constructor Detail

      • WebLink

        public WebLink​(String absoluteUri)
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
    • Method Detail

      • getRelative

        public String getRelative()
        Example:

        import ch.ivyteam.ivy.model.value.WebLink;

        WebLink link = new WebLink("http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi");
        link.getRelative(); // /Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi
        link.getRelativeEncoded(); // /Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=gr%C3%BCezi
        link.getAbsolute(); // http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi
        link.getAbsoluteEncoded(); // http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=gr%C3%BCezi

        Returns:
        the relative uri without protocol, hostname etc.
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getRelativeEncoded

        public String getRelativeEncoded()
        Example:

        import ch.ivyteam.ivy.model.value.WebLink;

        WebLink link = new WebLink("http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi");
        link.getRelative(); // /Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi
        link.getRelativeEncoded(); // /Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=gr%C3%BCezi
        link.getAbsolute(); // http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi
        link.getAbsoluteEncoded(); // http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=gr%C3%BCezi

        Returns:
        the encoded relative uri without protocol, hostname etc.
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • getAbsolute

        public String getAbsolute()
        Example:

        import ch.ivyteam.ivy.model.value.WebLink;

        WebLink link = new WebLink("http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi");
        link.getRelative(); // /Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi
        link.getRelativeEncoded(); // /Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=gr%C3%BCezi
        link.getAbsolute(); // http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi
        link.getAbsoluteEncoded(); // http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=gr%C3%BCezi

        Returns:
        the absolute uri including protocol, host name etc.
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • getAbsoluteEncoded

        public String getAbsoluteEncoded()
        Example:

        import ch.ivyteam.ivy.model.value.WebLink;

        WebLink link = new WebLink("http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi");
        link.getRelative(); // /Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi
        link.getRelativeEncoded(); // /Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=gr%C3%BCezi
        link.getAbsolute(); // http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=grüezi
        link.getAbsoluteEncoded(); // http://localhost/Portal/pro/SelfServiceBpm/14232C3D829C4D71/start.ivp?search=gr%C3%BCezi

        Returns:
        the encoded absolute uri including protocol, host name etc.
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • toUri

        public URI toUri()
        Returns the relative uri.
        Returns:
        the relative uri URI
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • toAbsoluteUri

        public URI toAbsoluteUri()
        Returns the absolute uri.
        Returns:
        the absolute uri
        API:
        This public API is available in IvyScript and Java. It has the visibility EXPERT.
      • queryParam

        public WebLink queryParam​(String name,
                                  String value)
        Adds a new query parameter to the uri.
        Parameters:
        name - of the query parameter
        value - of the query parameter.
        Returns:
        returns a new WebLink with the added query parameter.
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.
      • queryParams

        public WebLink queryParams​(Map<String,​String> params)
        Adds the query parameters to the uri.
        Parameters:
        params - name value map of the query parameters to add.
        Returns:
        returns a new WebLink with the added query parameters.
        API:
        This public API is available in IvyScript and Java. It has the visibility NOVICE.