public ResourceKey deriveKey(final ResourceKey parent, final String path, final Map factoryKeys)
throws ResourceKeyCreationException
{
if (isSupportedKey(parent) == false)
{
throw new ResourceKeyCreationException("Assertation: Unsupported parent key type");
}
try
{
final URL url;
if (path != null)
{
url = new URL((URL) parent.getIdentifier(), path);
}
else
{
url = (URL) parent.getIdentifier();
}
final Map map;
if (factoryKeys != null)
{
map = new HashMap();
map.putAll(parent.getFactoryParameters());
map.putAll(factoryKeys);
}
else
{
map = parent.getFactoryParameters();
}
return new ResourceKey(parent.getSchema(), url, map);
}
catch (MalformedURLException e)
{
throw new ResourceKeyCreationException("Malformed value: " + path);
}
}