1 package edu
.berkeley
.cs
.bodik
.svelte
.plugin
.sgview
;
4 import java
.io
.FileNotFoundException
;
6 public class StupidDotFinder
{
7 private static String dotLocation
= null;
8 private static final String
[] commonLocations
= {
11 "c:\\Program Files\\Graphviz2.18\\bin\\dot.exe",
12 "c:\\Program Files\\Graphviz2.16.1\\bin\\dot.exe",
14 public static String
getDotLocation() throws FileNotFoundException
{
15 if ( dotLocation
== null ) {
16 dotLocation
= whereIsDot();
17 if ( dotLocation
== null )
18 throw new FileNotFoundException("StupidDotFinder could not find dot, please make sure Dot installed or add path in StupidDotFinder");
23 private static String
whereIsDot() {
24 for ( String s
: commonLocations
)
25 if ( new File(s
).exists() )