public void run ( XmlEditor editor , File destination ) throws NoSuchAlgorithmException , IOException { editor . startPrefixMapping ( "http://redline-rpm.org/ns" , "rpm" ) ; Contents include = new Contents ( ) ; for ( Node files : editor . findNodes ( "rpm:files" ) ) { try { editor . pushContext ( files ) ; int permission = editor . getInteger ( "@permission" , DEFAULT_FILE_PERMISSION ) ; String parent = editor . getValue ( "@parent" ) ; if ( ! parent . endsWith ( "/" ) ) parent += "/" ; for ( Node file : editor . findNodes ( "rpm:file" ) ) { try { editor . pushContext ( file ) ; File source = new File ( editor . getValue ( "text()" ) ) ; include . addFile ( new File ( parent , source . getName ( ) ) . getPath ( ) , source , editor . getInteger ( "@permission" , permission ) ) ; } finally { editor . popContext ( ) ; } } } finally { editor . popContext ( ) ; } } run ( editor , editor . getValue ( "rpm:name/text()" ) , editor . getValue ( "rpm:version/text()" ) , editor . getValue ( "rpm:release/text()" , "1" ) , include , destination ) ; }
Runs the tool using a configuration provided in the given configuration and output file .