JAL-3013 resolve symlink to hmmer binaries folder features/mchmmer
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 6 Jun 2018 14:33:26 +0000 (15:33 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 6 Jun 2018 14:33:26 +0000 (15:33 +0100)
src/jalview/hmmer/HmmerCommand.java

index f8f2cde..b5c1b25 100644 (file)
@@ -24,6 +24,7 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.PrintWriter;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.List;
@@ -247,10 +248,13 @@ public abstract class HmmerCommand implements Runnable
    * @param cmd
    *          command short name e.g. hmmalign
    * @return
+   * @throws IOException
    */
-  protected String getCommandPath(String cmd)
+  protected String getCommandPath(String cmd) throws IOException
   {
     String binariesFolder = Cache.getProperty(Preferences.HMMER_PATH);
+    // ensure any symlink to the directory is resolved:
+    binariesFolder = Paths.get(binariesFolder).toRealPath().toString();
     File file = FileUtils.getExecutable(cmd, binariesFolder);
     if (file == null && af != null)
     {