net.sourceforge.plantuml.dot.GraphvizVersions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.dot;
import java.io.File;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class GraphvizVersions {
// ::remove file when __CORE__
private final static GraphvizVersions singleton = new GraphvizVersions();
private final Map map = new ConcurrentHashMap();
private GraphvizVersions() {
}
public static GraphvizVersions getInstance() {
return singleton;
}
public GraphvizVersion getVersion(File f) {
if (f == null)
return null;
GraphvizVersion result = map.get(f);
if (result != null)
return result;
result = checkVersionSlow(f.getAbsolutePath());
map.put(f, result);
return result;
}
static GraphvizVersion checkVersionSlow(String pathExecutable) {
final GraphvizVersionFinder finder = new GraphvizVersionFinder(new File(pathExecutable));
return finder.getVersion();
}
}