private void processImportElement(StartElement element,XMLEventWriter writer,Properties metadata) throws XMLStreamException, IOException {
  File file=new File(baseDir,getAttributeValue(element,qNameFile,null,"Attribute 'file' is missing or empty."));
  if (!file.exists()) {
    throw new FileNotFoundException("Missing file to import:" + file.getPath());
  }
  boolean skipRoot=Boolean.valueOf(getAttributeValue(element,qNameSkipRoot,"false",null));
  boolean recImport=Boolean.valueOf(getAttributeValue(element,qNameRecursiveImport,"true",null));
  if (file.isFile()) {
    importFile(file,skipRoot,writer,metadata);
  }
 else {
    logger.debug("Processing dir " + file);
    Collection<File> files=listFiles(file,recImport);
    for (    File childFile : files) {
      importFile(childFile,skipRoot,writer,metadata);
    }
  }
}

private void processImportElement ( StartElement element , XMLEventWriter writer , Properties metadata ) throws XMLStreamException , IOException { File file = new File ( baseDir , getAttributeValue ( element , qNameFile , null , "Attribute 'file' is missing or empty." ) ) ; if ( ! file . exists ( ) ) { throw new FileNotFoundException ( "Missing file to import:" + file . getPath ( ) ) ; } boolean skipRoot = Boolean . valueOf ( getAttributeValue ( element , qNameSkipRoot , "false" , null ) ) ; boolean recImport = Boolean . valueOf ( getAttributeValue ( element , qNameRecursiveImport , "true" , null ) ) ; if ( file . isFile ( ) ) { importFile ( file , skipRoot , writer , metadata ) ; } else { logger . debug ( "Processing dir " + file ) ; Collection < File > files = listFiles ( file , recImport ) ; for ( File childFile : files ) { importFile ( childFile , skipRoot , writer , metadata ) ; } } }
this method processes the ' import ' element , replacing it by the data from the relevant files .
