]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/ExternalTools.java
Version 16, February 2014
[GpsPrune.git] / tim / prune / ExternalTools.java
index a2d3e56b6f75c2315832f8c89809a3d442fd6159..8cd1aef178f44c80674af5923a7a4937ec9e4466 100644 (file)
@@ -2,6 +2,8 @@ package tim.prune;
 
 import java.io.IOException;
 
+import tim.prune.config.Config;
+
 
 /**
  * Class to manage interfaces to external tools, like exiftool
@@ -14,6 +16,8 @@ public abstract class ExternalTools
        public static final int TOOL_GPSBABEL = 1;
        /** Constant for Gnuplot */
        public static final int TOOL_GNUPLOT  = 2;
+       /** Constant for Xerces xml library */
+       public static final int TOOL_XERCES   = 3;
        /** Config keys in order that the tools are defined above */
        private static final String[] CONFIG_KEYS = {Config.KEY_EXIFTOOL_PATH, Config.KEY_GPSBABEL_PATH, Config.KEY_GNUPLOT_PATH};
        /** Verification flags for the tools in the order defined above */
@@ -35,6 +39,15 @@ public abstract class ExternalTools
                                if (toolPath != null && toolPath.length() > 0) {
                                        return check(toolPath + " " + VERIFY_FLAGS[inToolNum]);
                                }
+                               break;
+                       case TOOL_XERCES:
+                               try {
+                                       return Class.forName("org.apache.xerces.parsers.SAXParser").getClassLoader() != null;
+                               }
+                               catch (ClassNotFoundException e) {
+                                       // System.err.println(e.getClass().getName() + " : " + e.getMessage());
+                               }
+                               break;
                }
                // Not found
                return false;
@@ -65,7 +78,6 @@ public abstract class ExternalTools
         */
        private static boolean check(String inCommand)
        {
-               // System.out.println("Checking tool '" + inCommand + "'");
                try
                {
                        Runtime.getRuntime().exec(inCommand);