com.mindbright.ssh
Class SSHRemoteFileBrowsingConsole

java.lang.Object
  extended bycom.isnetworks.ssh.AbstractFileBrowser
      extended bycom.mindbright.ssh.SSHRemoteFileBrowsingConsole
All Implemented Interfaces:
ExpectOutputStream.Expector, com.isnetworks.ssh.FileBrowser

public class SSHRemoteFileBrowsingConsole
extends com.isnetworks.ssh.AbstractFileBrowser
implements ExpectOutputStream.Expector


Field Summary
 
Fields inherited from class com.isnetworks.ssh.AbstractFileBrowser
dirs, files, mFileDisplay
 
Constructor Summary
SSHRemoteFileBrowsingConsole(com.isnetworks.ssh.FileDisplay fileDisplay, java.lang.String remoteLSCommand, SSHFileTransferDialog errorLog, SSHConsoleRemote remote, java.lang.String cwd)
           
 
Method Summary
 void changeDirectory(java.lang.String directoryName)
          Does a "cd" on the remote machine
 void closed(ExpectOutputStream out, byte[] buf, int len)
           
 void delete(com.isnetworks.ssh.FileListItem[] fileListItem)
          Does a "rmdir" for directories in the array and a "rm" for files Will not delete non-empty directories
 void disconnect()
          Shut down the connection to the remote machine if it's active
 void doCommand(java.lang.StringBuffer command)
           
 void fileDoubleClicked(com.isnetworks.ssh.FileListItem fileListItem)
          User double clicked on a file in the list.
 void initialize()
          Kick up a new connection to the remote machine, killing the current one if it's still active
 void makeDirectory(java.lang.String directoryName)
          Executes a "mkdir" on the remote machine
 void reached(ExpectOutputStream out, byte[] buf, int len)
           
 void refresh()
          Rather ugly way to get the current directory on the server and a list of files
 void rename(com.isnetworks.ssh.FileListItem oldFile, java.lang.String newName)
          Executes a "mv" on the remote machine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSHRemoteFileBrowsingConsole

public SSHRemoteFileBrowsingConsole(com.isnetworks.ssh.FileDisplay fileDisplay,
                                    java.lang.String remoteLSCommand,
                                    SSHFileTransferDialog errorLog,
                                    SSHConsoleRemote remote,
                                    java.lang.String cwd)
Method Detail

initialize

public void initialize()
                throws java.lang.Exception
Kick up a new connection to the remote machine, killing the current one if it's still active

Specified by:
initialize in interface com.isnetworks.ssh.FileBrowser
Throws:
java.lang.Exception

disconnect

public void disconnect()
Shut down the connection to the remote machine if it's active

Specified by:
disconnect in interface com.isnetworks.ssh.FileBrowser

refresh

public void refresh()
             throws java.lang.Exception
Rather ugly way to get the current directory on the server and a list of files

Specified by:
refresh in interface com.isnetworks.ssh.FileBrowser
Throws:
java.lang.Exception

makeDirectory

public void makeDirectory(java.lang.String directoryName)
                   throws java.lang.Exception
Executes a "mkdir" on the remote machine

Specified by:
makeDirectory in interface com.isnetworks.ssh.FileBrowser
Throws:
java.lang.Exception

rename

public void rename(com.isnetworks.ssh.FileListItem oldFile,
                   java.lang.String newName)
            throws java.lang.Exception
Executes a "mv" on the remote machine

Specified by:
rename in interface com.isnetworks.ssh.FileBrowser
Throws:
java.lang.Exception

changeDirectory

public void changeDirectory(java.lang.String directoryName)
                     throws java.lang.Exception
Does a "cd" on the remote machine

Specified by:
changeDirectory in interface com.isnetworks.ssh.FileBrowser
Throws:
java.lang.Exception

delete

public void delete(com.isnetworks.ssh.FileListItem[] fileListItem)
            throws java.lang.Exception
Does a "rmdir" for directories in the array and a "rm" for files Will not delete non-empty directories

Specified by:
delete in interface com.isnetworks.ssh.FileBrowser
Throws:
java.lang.Exception

doCommand

public void doCommand(java.lang.StringBuffer command)
               throws java.lang.Exception
Throws:
java.lang.Exception

fileDoubleClicked

public void fileDoubleClicked(com.isnetworks.ssh.FileListItem fileListItem)
                       throws java.lang.Exception
User double clicked on a file in the list. Check if it's a directory and change to it if it is.

Specified by:
fileDoubleClicked in interface com.isnetworks.ssh.FileBrowser
Throws:
java.lang.Exception

reached

public void reached(ExpectOutputStream out,
                    byte[] buf,
                    int len)
Specified by:
reached in interface ExpectOutputStream.Expector

closed

public void closed(ExpectOutputStream out,
                   byte[] buf,
                   int len)
Specified by:
closed in interface ExpectOutputStream.Expector