Search in sources :

Example 6 with ProgressInfo

use of apoc.result.ProgressInfo in project neo4j-apoc-procedures by neo4j-contrib.

the class ExportGraphML method exportGraphML.

private Stream<ProgressInfo> exportGraphML(@Name("file") String fileName, String source, SubGraph graph, ExportConfig config) throws Exception, XMLStreamException {
    FileUtils.checkReadAllowed(fileName);
    ProgressReporter reporter = new ProgressReporter(null, null, new ProgressInfo(fileName, source, "graphml"));
    PrintWriter printWriter = getPrintWriter(fileName, null);
    XmlGraphMLWriter exporter = new XmlGraphMLWriter();
    exporter.write(graph, printWriter, reporter, config);
    printWriter.flush();
    printWriter.close();
    return reporter.stream();
}
Also used : ProgressInfo(apoc.result.ProgressInfo) ProgressReporter(apoc.export.util.ProgressReporter) PrintWriter(java.io.PrintWriter) FileUtils.getPrintWriter(apoc.util.FileUtils.getPrintWriter)

Aggregations

ProgressInfo (apoc.result.ProgressInfo)6 ProgressReporter (apoc.export.util.ProgressReporter)4 ExportConfig (apoc.export.util.ExportConfig)2 FileUtils.getPrintWriter (apoc.util.FileUtils.getPrintWriter)2 PrintWriter (java.io.PrintWriter)2 Result (org.neo4j.graphdb.Result)2 Description (org.neo4j.procedure.Description)2 Procedure (org.neo4j.procedure.Procedure)2 NodesAndRelsSubGraph (apoc.export.util.NodesAndRelsSubGraph)1 QueueBasedSpliterator (apoc.util.QueueBasedSpliterator)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 ArrayBlockingQueue (java.util.concurrent.ArrayBlockingQueue)1 DatabaseSubGraph (org.neo4j.cypher.export.DatabaseSubGraph)1 SubGraph (org.neo4j.cypher.export.SubGraph)1 Node (org.neo4j.graphdb.Node)1 QueryStatistics (org.neo4j.graphdb.QueryStatistics)1 Relationship (org.neo4j.graphdb.Relationship)1