gexf4j-core icon indicating copy to clipboard operation
gexf4j-core copied to clipboard

Save/Write gexf - File

Open IjonTichyRaumpilot opened this issue 14 years ago • 1 comments

The Example you gave at http://gexf.net/gexf4j/ lead me to the question how do you save the gexf-File. I found StaxGraphWriter and added the following to get the demo saving the file. It might help if you could add such things to the demo to understand more easily.

At the end I added:

            String gexfFileName = "C:/temp/graph.gexf";
    StaxGraphWriter graphWriter = new StaxGraphWriter();
    FileOutputStream out = null;
    try {
        out = new FileOutputStream(gexfFileName);
    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    try {
        graphWriter.writeToStream(gexf, out);
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

IjonTichyRaumpilot avatar Aug 05 '11 10:08 IjonTichyRaumpilot

It should be new FileOutputStream(new File(gexfFileName));

Sarnath avatar Aug 30 '11 00:08 Sarnath