// Create a stream for the data and write the data to the file
PrintStream theStream = new PrintStream( new FileOutputStream( deployFile ) );
try {
constructDeployXML( theStream );
if( theStream.checkError() ) throw new IOException();
} catch (Exception e) {
throw new IOException( "Unable to write data to deploy file" +
deployFile.getPath() );
} finally {
theStream.close();