/** * Determine the child structure * * @param child the child * @return true when recognised * @throws DeploymentException for any error */ public boolean determineChildStructure(VirtualFile child) throws DeploymentException { if (child == null) throw new IllegalArgumentException("Null child"); return getDeployers().determineStructure(child, this); }
/** * Create a new child structure context * * @param file the candidate file * @param metaData the structure metadata to build * @param parentContext the parentContext * @throws IllegalArgumentException for a null parameter */ public StructureContext(VirtualFile file, StructureMetaData metaData, StructureContext parentContext) { this(getRoot(parentContext), parentContext.getFile(), file, metaData, parentContext.getDeployers(), parentContext); }
public boolean determineStructure(StructureContext context) throws DeploymentException { try { VirtualFile file = context.getFile(); // jar structure should already handle top level dirs if (context.isTopLevel() == false && isLeaf(file) == false && isMetadataPath(context) == false) { List<VirtualFile> children = file.getChildren(); if (children != null && children.isEmpty() == false) { VFSStructuralDeployers structuralDeployers = context.getDeployers(); // get top while (context.getParentContext() != null) context = context.getParentContext(); for (VirtualFile child : children) structuralDeployers.determineStructure(child, context); } } return false; } catch (Exception e) { throw DeploymentException.rethrowAsDeploymentException("Error determining structure.", e); } }