stupid dot finder
[eclipsethinslicer.git] / Svelte / src / edu / berkeley / cs / bodik / svelte / plugin / sgview / StupidDotFinder.java
blob6cbcfc762823240443e256768904c6d91ff5ad6e
1 package edu.berkeley.cs.bodik.svelte.plugin.sgview;
3 import java.io.File;
4 import java.io.FileNotFoundException;
6 public class StupidDotFinder {
7 private static String dotLocation = null;
8 private static final String[] commonLocations = {
9 "/usr/bin/dot",
10 "/usr/local/bin/dot",
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");
20 return dotLocation;
23 private static String whereIsDot() {
24 for ( String s: commonLocations )
25 if ( new File(s).exists() )
26 return s;
27 return null;