package org.jboss.windup.engine.visitor.reporter;

import java.io.File;
import java.io.FileOutputStream;

import javax.inject.Inject;

import org.jboss.windup.engine.visitor.AbstractGraphVisitor;
import org.jboss.windup.engine.visitor.VisitorPhase;
import org.jboss.windup.graph.WindupContext;
import org.jboss.windup.graph.renderer.GraphMLRenderer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.tinkerpop.blueprints.util.io.graphml.GraphMLWriter;

/**
 * Serializes the graph to GraphML.
 * 
 * @author bradsdavis@gmail.com
 * 
 */
public class GraphRenderReporter extends AbstractGraphVisitor
{
    private static final Logger LOG = LoggerFactory.getLogger(GraphRenderReporter.class);

    @Inject
    private GraphMLRenderer graphMLRenderer;

    @Override
    public VisitorPhase getPhase()
    {
        return VisitorPhase.REPORTING;
    }

    @Override
    public void run()
    {
        File graphLocation = new File("/home/jsightler/tmp/", "graphml.graphml");
        graphMLRenderer.renderGraphML(graphLocation);
        LOG.debug("Wrote graph to: " + graphLocation.getAbsolutePath());
    }

}

@@ -84,27 +84,21 @@
 .io.
-FileOutputStream
+IOException
 ;%0A
-%0A
 impo
@@ -121,17 +121,16 @@
 Inject;%0A
-%0A
 import o
@@ -239,53 +239,8 @@
 se;%0A
-import org.jboss.windup.graph.WindupContext;%0A
 impo
@@ -353,72 +353,8 @@
 y;%0A%0A
-import com.tinkerpop.blueprints.util.io.graphml.GraphMLWriter;%0A%0A
 /**%0A
@@ -823,48 +823,83 @@
  = n
-ew File(%22/home/jsightler/tmp/%22, 
+ull;%0A        try %7B%0A            graphLocation = File.createTempFile(
 %22graphml
 .gra
@@ -894,16 +894,19 @@
 %22graphml
+%22,%22
 .graphml
@@ -909,16 +909,20 @@
 phml%22);%0A
+    
         
@@ -975,16 +975,20 @@
         
+    
 LOG.debu
@@ -1044,16 +1044,108 @@
 ath());%0A
+        %7D catch( IOException ex ) %7B%0A            LOG.error( ex.getMessage(), ex );%0A        %7D%0A
     %7D%0A%0A%7D

Remove hardcoded tmp path