connect(device.getHost());
setRemoteHost(device.getHost()); setTimeout(300000); AccessController.doPrivileged( new PrivilegedAction(){ public Object run() { try{ connect(); return null; }catch(Exception e){ throw new RuntimeException(e); } } });
    public FTPFileSystem(FTPFSDevice device) {        this.device = device;        device.addListener(new DeviceListener() {            public void deviceStarted(Device device) {                //empty            }            public void deviceStop(Device device) {                try {                    close();                } catch(IOException x){                    x.printStackTrace();                }            }        });        try{//            setRemoteHost(device.getHost());//            setTimeout(300000);//            connect();            connect(device.getHost());            login(device.getUser(),device.getPassword());            thread = new Thread(new Runnable(){                public void run() {                    try{                        while(!isClosed()){                            try {                                Thread.sleep(100000);                                nop();                            }catch(InterruptedException x){                                //ignore                            }                        }                    } catch(Exception x){                        x.printStackTrace();                    }                }            },"ftpfs_keepalive");            thread.start();            //FTPFile f = new FTPFile("/", "/", 0, true, new Date(0));            FTPFile f = new FTPFile();            f.setName(printWorkingDirectory());            root = new FTPFSDirectory(this, f);            closed = false;        }catch(Exception e){            throw new RuntimeException(e);        }    }