public static void writeMapToXML ( final Map < URI , Set < URI > > m , final File outputFile ) throws IOException { if ( m == null ) { return ; } final Properties prop = new Properties ( ) ; for ( final Map . Entry < URI , Set < URI > > entry : m . entrySet ( ) ) { final URI key = entry . getKey ( ) ; final String value = StringUtils . join ( entry . getValue ( ) , COMMA ) ; prop . setProperty ( key . getPath ( ) , value ) ; } try ( OutputStream os = new FileOutputStream ( outputFile ) ) { prop . storeToXML ( os , null ) ; } catch ( final IOException e ) { throw new IOException ( "Failed to write subject scheme graph: " + e . getMessage ( ) , e ) ; } }
Write map of sets to a file .