Javadocs and unit tests.

This commit is contained in:
akwizgran
2011-07-01 12:07:00 +01:00
parent b29a024c2a
commit 0ed2a7c9e7
23 changed files with 235 additions and 59 deletions

View File

@@ -18,19 +18,12 @@ public class FileUtils {
assert f.exists();
if(f.isFile()) {
// Running from a jar - return the jar's grandparent
try {
f = f.getCanonicalFile().getParentFile().getParentFile();
} catch(IOException e) {
throw new RuntimeException(e);
}
f = f.getParentFile().getParentFile();
} else {
// Running from Eclipse
try {
f = new File(f.getCanonicalFile().getParentFile(), "Briar");
} catch(IOException e) {
throw new RuntimeException(e);
}
f.mkdir();
// Running from Eclipse or ant
f = new File(f.getParentFile(), "Briar");
if(!f.exists())
f = new File(f.getParentFile().getParentFile(), "Briar"); // Ant
}
assert f.exists();
assert f.isDirectory();