forked from workcraft/workcraft
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request workcraft#1290 from danilovesky/refinement-canonic…
…al-path Use canonical path for base dir of file references
- Loading branch information
Showing
4 changed files
with
39 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 8 additions & 10 deletions
18
workcraft/WorkcraftCore/src/org/workcraft/utils/ExecutableUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
package org.workcraft.utils; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
public class ExecutableUtils { | ||
|
||
public static String getAbsoluteCommandPath(String toolName) { | ||
return getAbsoluteCommandPath(new File(toolName)); | ||
} | ||
|
||
public static String getAbsoluteCommandPath(File file) { | ||
String result = null; | ||
if (file != null) { | ||
result = file.getPath(); | ||
if (file.exists()) { | ||
result = FileUtils.getFullPath(file); | ||
File toolFile = new File(toolName); | ||
if (toolFile.exists()) { | ||
try { | ||
return toolFile.getCanonicalPath(); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
return result; | ||
return toolFile.getPath(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters