// Path: components/script-engine/org.jaggeryjs.scriptengine/src/main/java/org/jaggeryjs/scriptengine/exceptions/ScriptException.java
// public class ScriptException extends Exception {
// 
//     public ScriptException(String message) {
//         super(message);
//     }
// 
//     public ScriptException(Exception exception) {
//         super(exception);
//     }
// 
//     public ScriptException(String message, Exception exception) {
//         super(message, exception);
//     }
// }


import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jaggeryjs.scriptengine.exceptions.ScriptException;
import javax.activation.FileTypeMap;
import java.io.*;
import java.util.ArrayList;
import static java.lang.Math.min;
package org.jaggeryjs.hostobjects.file;




public class JavaScriptFileImpl implements JavaScriptFile {

    private static final Log log = LogFactory.getLog(JavaScriptFileImpl.class);
    private RandomAccessFile file = null;
    private File f = null;
    private String path = null;
    private String uri = null;
    private boolean opened = false;

    private boolean readable = false;
    private boolean writable = false;

    private JavaScriptFileManager fileManager = new JavaScriptFileManagerImpl();

    public JavaScriptFileImpl(String uri, String path) {
        this.uri = uri;
        this.path = path;
    }

    @SuppressFBWarnings("PATH_TRAVERSAL_IN")
    @Override
// Path: components/script-engine/org.jaggeryjs.scriptengine/src/main/java/org/jaggeryjs/scriptengine/exceptions/ScriptException.java
// public class ScriptException extends Exception {
// 
//     public ScriptException(String message) {
//         super(message);
//     }
// 
//     public ScriptException(Exception exception) {
//         super(exception);
//     }
// 
//     public ScriptException(String message, Exception exception) {
//         super(message, exception);
//     }
// }


// Path: components/hostobjects/org.jaggeryjs.hostobjects.file/src/main/java/org/jaggeryjs/hostobjects/file/JavaScriptFileImpl.java
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jaggeryjs.scriptengine.exceptions.ScriptException;
import javax.activation.FileTypeMap;
import java.io.*;
import java.util.ArrayList;
import static java.lang.Math.min;

package org.jaggeryjs.hostobjects.file;




public class JavaScriptFileImpl implements JavaScriptFile {

    private static final Log log = LogFactory.getLog(JavaScriptFileImpl.class);
    private RandomAccessFile file = null;
    private File f = null;
    private String path = null;
    private String uri = null;
    private boolean opened = false;

    private boolean readable = false;
    private boolean writable = false;

    private JavaScriptFileManager fileManager = new JavaScriptFileManagerImpl();

    public JavaScriptFileImpl(String uri, String path) {
        this.uri = uri;
        this.path = path;
    }

    @SuppressFBWarnings("PATH_TRAVERSAL_IN")
    @Override
    public void construct() throws ScriptException {