]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/ExternalTools.java
Version 3, August 2007
[GpsPrune.git] / tim / prune / ExternalTools.java
diff --git a/tim/prune/ExternalTools.java b/tim/prune/ExternalTools.java
new file mode 100644 (file)
index 0000000..cd65fff
--- /dev/null
@@ -0,0 +1,48 @@
+package tim.prune;
+
+import java.io.IOException;
+
+
+/**
+ * Class to manage interfaces to external tools, like exiftool
+ */
+public abstract class ExternalTools
+{
+
+       /**
+        * Attempt to call Povray to see if it's installed / available in path
+        * @return true if found, false otherwise
+        */
+       public static boolean isPovrayInstalled()
+       {
+               try
+               {
+                       Runtime.getRuntime().exec("povray");
+                       return true;
+               }
+               catch (IOException ioe)
+               {
+                       // exception thrown, povray not found
+                       return false;
+               }
+       }
+
+
+       /**
+        * Attempt to call Exiftool to see if it's installed / available in path
+        * @return true if found, false otherwise
+        */
+       public static boolean isExiftoolInstalled()
+       {
+               try
+               {
+                       Runtime.getRuntime().exec("exiftool -v");
+                       return true;
+               }
+               catch (IOException ioe)
+               {
+                       // exception thrown, exiftool not found
+                       return false;
+               }
+       }
+}