litesoft
Diff Revisions
287
vs
298
for /trunk/Java/ScarPlus/src/com/esotericsoftware/scar/Utils.java
|
@@ -8,9 +8,11 @@ |
8 |
8 |
|
|
9 |
9 |
|
import javax.tools.*; |
10 |
10 |
|
|
|
11 |
+ |
import com.esotericsoftware.utils.*; |
|
12 |
+ |
|
11 |
13 |
|
import static com.esotericsoftware.minlog.Log.*; |
12 |
14 |
|
|
13 |
|
- |
public class Utils |
|
15 |
+ |
public class Utils extends Util |
14 |
16 |
|
{ |
15 |
17 |
|
/** |
16 |
18 |
|
* The Scar installation directory. The value comes from the SCAR_HOME environment variable, if it exists. Alternatively, the |
|
@@ -108,6 +110,23 @@ |
108 |
110 |
|
} |
109 |
111 |
|
} |
110 |
112 |
|
|
|
113 |
+ |
/** |
|
114 |
+ |
* Returns the canonical path for the specified path. Eg, if "." is passed, this will resolve the actual path and return it. |
|
115 |
+ |
*/ |
|
116 |
+ |
static public File canonical( File path ) |
|
117 |
+ |
{ |
|
118 |
+ |
assertNotNull( "path", path ); |
|
119 |
+ |
|
|
120 |
+ |
try |
|
121 |
+ |
{ |
|
122 |
+ |
return path.getCanonicalFile(); |
|
123 |
+ |
} |
|
124 |
+ |
catch ( IOException ex ) |
|
125 |
+ |
{ |
|
126 |
+ |
return path.getAbsoluteFile(); |
|
127 |
+ |
} |
|
128 |
+ |
} |
|
129 |
+ |
|
111 |
130 |
|
/** |
112 |
131 |
|
* Deletes a file or directory and all files and subdirecties under it. |
113 |
132 |
|
*/ |