Skip to content

Overview

Development

Overview

IDEs

API Explorer

UrlMethods

The UrlMethods class contains utility one-liners for manipulating URLs such as extracting parts of the URL or building a URL from a given HttpServletRequest object. Methods in this class can be used in both Gloop and Groovy.

These are the different ways of using UrlMethods:

Sample Gloop service showing how to use the UrlMethods one-liners

1
2
assert 'http://example.org/index.jsp'.filenameFromUrl().equals('index.jsp')
assert 'deer'.extractRemainder('http://example.org/animals/deer/bambi').equals('http://example.org/animals')