} else {
offsetPath = uriPattern;
}
// Shift the default route (if any) of the default host
Route defaultRoute = component.getDefaultHost()
.getDefaultRoute();
if (defaultRoute != null) {
defaultRoute.getTemplate().setPattern(
offsetPath
+ defaultRoute.getTemplate()
.getPattern());
log("[Noelios Restlet Engine] - Attaching restlet: "
+ defaultRoute.getNext()
+ " to URI: "
+ offsetPath
+ defaultRoute.getTemplate().getPattern());
}
// Shift the routes of the default host
for (final Route route : component.getDefaultHost()
.getRoutes()) {
log("[Noelios Restlet Engine] - Attaching restlet: "
+ route.getNext()
+ " to URI: "
+ offsetPath
+ route.getTemplate().getPattern());
route.getTemplate().setPattern(
offsetPath
+ route.getTemplate().getPattern());
}
for (final VirtualHost virtualHost : component
.getHosts()) {
// Shift the default route (if any) of the virtual
// host
defaultRoute = virtualHost.getDefaultRoute();
if (defaultRoute != null) {
defaultRoute.getTemplate().setPattern(
offsetPath
+ defaultRoute.getTemplate()
.getPattern());
log("[Noelios Restlet Engine] - Attaching restlet: "
+ defaultRoute.getNext()
+ " to URI: "
+ offsetPath
+ defaultRoute.getTemplate()
.getPattern());
}
// Shift the routes of the virtual host
for (final Route route : virtualHost.getRoutes()) {
log("[Noelios Restlet Engine] - Attaching restlet: "