* 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:
parent
2108be3807
commit
3e7c260787
1 changed files with 6 additions and 2 deletions
|
@ -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,
|
||||||
|
|
Loading…
Add table
Reference in a new issue