protected void determineStructure(Deployment deployment, StructureMetaData structure) throws Exception
{
if (deployment instanceof VFSDeployment == false)
throw new DeploymentException("Structure can only be determined for VFSDeployments " + deployment);
VFSDeployment vfsDeployment = (VFSDeployment) deployment;
VirtualFile root = vfsDeployment.getRoot();
if (root == null)
throw new IllegalStateException("Deployment has no root " + deployment);
StructureContext context = new StructureContext(root, structure, this);
if (doDetermineStructure(context) == false)
throw new DeploymentException("No deployer recognised the structure of " + deployment.getName());