4 import java.io.IOException;
7 * Miscellaneous file-related functions
9 public final class FileUtils
13 * Answers the executable file for the given command, or null if not found or
14 * not executable. The path to the executable is the command name prefixed by
15 * the given folder path, optionally with .exe appended.
18 * command short name, for example hmmbuild
20 * parent folder for the executable
23 public static File getExecutable(String cmd, String binaryPath)
25 File file = new File(binaryPath, cmd);
26 if (!file.canExecute())
28 file = new File(binaryPath, cmd + ".exe");
30 if (!file.canExecute())
40 * A convenience method to create a temporary file that is deleted on exit of
48 public static File createTempFile(String prefix, String suffix)
51 File f = File.createTempFile(prefix, suffix);