Skip to content

Toro Cloud Dev Center


UrlFunctions

The Url class contains utility functions for manipulating URLs such as extracting parts of the URL or building a URL from a given HttpServletRequest object. Functions in this class can be used in both Gloop and Groovy.

These are the different ways of using UrlFunctions:

Sample service showing how to use the `Url` functions

1
2
3
4
5
6
7
8
// Retrieve a HttpServletRequest object
def request = ...

// Get the base URL from the request
def baseUrl = request.getBaseUrl()

// Get the file name from the URL
def fileName = baseUrl.filenameFromUrl()