* 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> (merge to helma_1_5
  from HEAD)
This commit is contained in:
hns 2006-10-23 18:36:48 +00:00
parent c0cc7a633d
commit be47e80327

View file

@ -50,11 +50,15 @@ public class FileObject extends ScriptableObject {
} }
protected FileObject(String fileName) { 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) { 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, public static FileObject fileObjCtor(Context cx, Object[] args,