@ JSConstructor public static Scriptable jsConstructor ( Context cx , Object [ ] args , Function ctorObj , boolean inNewExpr ) { File result = new File ( ) ; if ( args . length == 0 || args [ 0 ] == Context . getUndefinedValue ( ) ) { result . name = "" ; result . file = null ; } else { result . name = Context . toString ( args [ 0 ] ) ; result . file = new java . io . File ( result . name ) ; } return result ; }
The Java method defining the JavaScript File constructor .