public BaseLocation getBaseLocation(SelectedVariant selected) {
Variant variant = selected.getVariant();
Content content = variant.getContent();
if (content instanceof BaseURLRelative) {
BaseURLRelative relative = (BaseURLRelative) content;
BaseLocation baseLocation = relative.getBaseLocation();
if (baseLocation != BaseLocation.DEFAULT) {
return baseLocation;
}
RuntimePolicyReference reference = (RuntimePolicyReference)
relative.getBaseURLPolicyReference();
if (reference != null) {
BaseURLPolicy policy = (BaseURLPolicy)
policyFetcher.fetchPolicy(reference);
if (policy != null) {
baseLocation = policy.getBaseLocation();