* Convert file name to absolute path in constructor to work around java.io.File glitches.

Fixes bug 488 <http://helma.org/bugs/show_bug.cgi?id=488>
This commit is contained in:
hns 2006-09-27 14:09:11 +00:00
parent 2108be3807
commit 3e7c260787

View file

@ -50,11 +50,15 @@ public class FileObject extends ScriptableObject {
}
protected FileObject(String fileName) {
file = new File(fileName);
// always convert to absolute file straight away, since
// relative file name handling is pretty broken in java.io.File
file = new File(fileName).getAbsoluteFile();
}
protected FileObject(String pathName, String fileName) {
file = new File(pathName, fileName);
// always convert to absolute file straight away, since
// relative file name handling is pretty broken in java.io.File
file = new File(pathName, fileName).getAbsoluteFile();
}
public static FileObject fileObjCtor(Context cx, Object[] args,