}
public boolean determineStructure(StructureContext structureContext) throws DeploymentException
{
ContextInfo context = null;
VirtualFile file = structureContext.getFile();
try
{
boolean trace = log.isTraceEnabled();
if (isLeaf(file) == true)
{
boolean isFile = false;
if( trace )
log.trace(file + " is a leaf");
// See if this is a top-level by checking the parent
if (structureContext.isTopLevel() == false)
{
if (isKnownFile(file.getName()) == false && checkFileMatchers(file) == false)
{
if (trace)
log.trace("... no - it is not a top level file and not a known name");
}
else
{
if (trace)
log.trace("... ok - not a top level file but it is a known name");
isFile = true;
}
}
else
{
if (trace)
log.trace("... ok - it is a top level file");
isFile = true;
}
// Create a context info for this file
if (isFile)
context = createContext(structureContext);
// There are no subdeployments for files
if (trace)
log.trace(file + " isFile: " + isFile);
return isFile;
}
else
{
if (trace)
log.trace("... no - not a file.");
return false;
}
}
catch (Exception e)
{
if (context != null)
structureContext.removeChild(context);
throw DeploymentException.rethrowAsDeploymentException("Error determining structure: " + file.getName(), e);
}
}