code: public static void renderGraph(File dotfile, File resultfile) throws IOException {
  		// call graphviz-dot via commons-exec
  		CommandLine cmdLine = new CommandLine(DOT_EXE);
  		cmdLine.addArgument("-T" + StringUtils.substringAfterLast(resultfile.getAbsolutePath(), "."));
  		cmdLine.addArgument(dotfile.getAbsolutePath());
  		DefaultExecutor executor = new DefaultExecutor();
  		executor.setExitValue(0);
  		ExecuteWatchdog watchdog = new ExecuteWatchdog(60000);
  		executor.setWatchdog(watchdog);
  		try {
  			try (FileOutputStream out2 = new FileOutputStream(resultfile)) {
  				executor.setStreamHandler(new PumpStreamHandler(out2, System.err));
  				int exitValue = executor.execute(cmdLine);
  				if(exitValue != 0) {
  					throw new IOException("Could not convert graph to dot, had exit value: " + exitValue + "!");
  				}
  			}
  		} catch (IOException e) {
  			// if something went wrong the file should not be left behind...
  			if(!resultfile.delete()) {
  				System.out.println("Could not delete file " + resultfile);
  			}
  
  			throw e;
  		}
  	}
docs: Call graphviz-dot to convert the .dot-file to a rendered graph.
  
  The file extension of the specified result file is being used as the filetype
  of the rendering.
  
  @param dotfile The dot {@code File}  used for the graph generation
  @param resultfile The {@code File} to which should be written
  
  @throws IOException if writing the resulting graph fails or other I/O
  problems occur