class StaticDispatcherUrlService implements DispatcherUrlService {

	public String localize(String externalUrl) {
		String localBase = getLocalDispatcherUrl();
		if (localBase == null) {
			return externalUrl;
		} else {
			String dispatcherBase = getDispatcherUrl();
			if (externalUrl.startsWith(dispatcherBase)) {
				return localBase + externalUrl.substring(dispatcherBase.length());
			} else {
				// not a dispatcher url, return the original one
				return externalUrl;
			}
		}
	}

}