Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save/Write gexf - File #4

Open
IjonTichyRaumpilot opened this issue Aug 5, 2011 · 1 comment
Open

Save/Write gexf - File #4

IjonTichyRaumpilot opened this issue Aug 5, 2011 · 1 comment

Comments

@IjonTichyRaumpilot
Copy link

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();
    }
@Sarnath
Copy link

Sarnath commented Aug 30, 2011

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants