private Set < String > parseIncludeNode ( Set < String > origResult , File serverFile , Element node , List < File > updatedParsedXmls ) { Set < String > result = origResult ; String includeFileName = node . getAttribute ( "location" ) ; if ( includeFileName == null || includeFileName . trim ( ) . isEmpty ( ) ) { return result ; } File includeFile = null ; if ( isURL ( includeFileName ) ) { try { File tempFile = File . createTempFile ( "serverFromURL" , ".xml" ) ; FileUtils . copyURLToFile ( new URL ( includeFileName ) , tempFile , COPY_FILE_TIMEOUT_MILLIS , COPY_FILE_TIMEOUT_MILLIS ) ; includeFile = tempFile ; } catch ( IOException e ) { // skip this xml if it cannot be accessed from URL warn ( "The server file " + serverFile + " includes a URL " + includeFileName + " that cannot be accessed. Skipping the included features." ) ; debug ( e ) ; return result ; } } else { includeFile = new File ( includeFileName ) ; } try { if ( ! includeFile . isAbsolute ( ) ) { includeFile = new File ( serverFile . getParentFile ( ) . getAbsolutePath ( ) , includeFileName ) . getCanonicalFile ( ) ; } else { includeFile = includeFile . getCanonicalFile ( ) ; } } catch ( IOException e ) { // skip this xml if its path cannot be queried warn ( "The server file " + serverFile + " includes a file " + includeFileName + " that cannot be accessed. Skipping the included features." ) ; debug ( e ) ; return result ; } if ( ! updatedParsedXmls . contains ( includeFile ) ) { String onConflict = node . getAttribute ( "onConflict" ) ; Set < String > features = getServerXmlFeatures ( null , includeFile , updatedParsedXmls ) ; result = handleOnConflict ( result , onConflict , features ) ; } return result ; }
Parse features from an include node .