public static void main ( String [ ] args ) { if ( args . length == 4 ) { File srcdir = new File ( args [ 0 ] ) ; File destdir = new File ( args [ 1 ] ) ; File xsl_examples = new File ( srcdir , args [ 2 ] ) ; File xsl_site = new File ( srcdir , args [ 3 ] ) ; try { System . out . print ( "Building tutorial: " ) ; root = new File ( args [ 1 ] , srcdir . getName ( ) ) . getCanonicalPath ( ) ; System . out . println ( root ) ; build = new FileWriter ( new File ( root , "build.xml" ) ) ; build . write ( "<project name=\"tutorial\" default=\"all\" basedir=\".\">\n" ) ; build . write ( "<target name=\"all\">\n" ) ; action ( srcdir , destdir , xsl_examples , xsl_site ) ; build . write ( "</target>\n</project>" ) ; build . flush ( ) ; build . close ( ) ; } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } } else { System . err . println ( "Wrong number of parameters.\nUsage: BuildSite srcdr destdir xsl_examples xsl_site" ) ; } }
Main method so you can call the convert method from the command line .