private static File materializeDescriptor ( ResourceSpecifier resource ) throws IOException , SAXException { File tempDesc = File . createTempFile ( "desc" , ".xml" ) ; // tempDesc.deleteOnExit(); BufferedWriter out = new BufferedWriter ( new OutputStreamWriter ( new FileOutputStream ( tempDesc ) , "UTF-8" ) ) ; resource . toXML ( out ) ; out . close ( ) ; return tempDesc ; }
Writes a temporary file containing a xml descriptor of the given resource . Returns the file .