net.sf.jfilesync.plugins.net.items
Class JSchPluginProxy

java.lang.Object
  extended by net.sf.jfilesync.plugins.net.items.JSchPluginProxy
All Implemented Interfaces:
GeneralPlugin, ConnectionPlugin

public class JSchPluginProxy
extends java.lang.Object
implements ConnectionPlugin


Nested Class Summary
(package private) static class JSchPluginProxy.JSchTask
           
(package private) static class JSchPluginProxy.JSchWorkerThread
           
 
Field Summary
private  TConnectionData connectData
           
private  JSchPlugin plugin
           
private  JSchPluginProxy.JSchWorkerThread workerThread
           
 
Fields inherited from interface net.sf.jfilesync.plugins.GeneralPlugin
PROVIDES_FILETRANSFER, PROVIDES_PERMISSION_HANDLING, PROVIDES_RSYNC, PROVIDES_SHELL, PROVIDES_SYMLINK_HANDLING
 
Constructor Summary
JSchPluginProxy()
           
 
Method Summary
 void abort()
           
 void chdir(java.lang.String path)
           
private  void checkWorkerThread()
           
 void connect(TConnectionData connectData)
           
 void disconnect()
           
 boolean exists(java.lang.String path)
           
 void get(java.lang.String remoteFileName, java.io.OutputStream outstream)
           
 java.lang.String getAbsolutePath()
           
 int getConnectionID()
          unique id of the connection plugin
 PluginOptionPanel getConnectionOptionPanel()
          returns a PluginOptionPanel with specific options for this plugin or null if the plugin does not provide options
 int getDefaultPort()
           
 java.lang.String getDescription()
           
 java.lang.String getLicense()
           
 int getMajorVersion()
           
 int getMinorVersion()
           
 java.lang.String getName()
           
 TPathControlInterface getPathControl()
           
 java.lang.String getProtocolString()
           
 TConnectionData getTConnectionData()
           
 java.lang.String getVersionString()
           
 boolean hasConnectionOptions()
          if plugin provides additional options it will return true
protected  java.lang.Object invokeTaskThrowingIOException(java.lang.String methodName, java.lang.Class[] paramClasses, java.lang.Object[] params)
           
protected  java.lang.Object invokeWorkerThreadAndWait(java.lang.String methodName, java.lang.Class[] paramClasses, java.lang.Object[] params)
           
 boolean isConnected()
           
 boolean isFile(java.lang.String path)
           
 boolean isLink(java.lang.String path)
           
 boolean isLocalConnection()
           
 boolean isProvided(int feature)
          plug-in must provide information if a feature is provided or not
 TFileData ls()
           
 TFileData ls(java.lang.String path)
           
 void mkdir(java.lang.String dir)
           
 void mkdirs(java.lang.String dir)
           
 void put(java.io.InputStream instream, java.lang.String remoteFileName)
           
 java.lang.String pwd()
           
 void remove(java.lang.String file)
           
 void rename(java.lang.String oldpath, java.lang.String newpath)
           
 boolean requiresPassword()
          returns true whether the user needs to enter a password considering the current plugin settings
 boolean requiresPort()
           
 void rmdir(java.lang.String dir)
           
 void setHidden(java.lang.String path)
           
 void setModificationTime(java.lang.String file, long mtime)
           
 void setPermissions(java.lang.String file, int permissions)
           
private  void shutdownWorkerThread()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workerThread

private JSchPluginProxy.JSchWorkerThread workerThread

plugin

private final JSchPlugin plugin

connectData

private TConnectionData connectData
Constructor Detail

JSchPluginProxy

public JSchPluginProxy()
Method Detail

checkWorkerThread

private void checkWorkerThread()

shutdownWorkerThread

private void shutdownWorkerThread()

connect

public void connect(TConnectionData connectData)
             throws PluginConnectException
Specified by:
connect in interface ConnectionPlugin
Throws:
PluginConnectException

getTConnectionData

public TConnectionData getTConnectionData()
Specified by:
getTConnectionData in interface ConnectionPlugin

disconnect

public void disconnect()
Specified by:
disconnect in interface ConnectionPlugin

isConnected

public boolean isConnected()
Specified by:
isConnected in interface ConnectionPlugin

isLocalConnection

public boolean isLocalConnection()
Specified by:
isLocalConnection in interface ConnectionPlugin

getPathControl

public TPathControlInterface getPathControl()
Specified by:
getPathControl in interface ConnectionPlugin

ls

public TFileData ls()
             throws java.io.IOException
Specified by:
ls in interface ConnectionPlugin
Throws:
java.io.IOException

ls

public TFileData ls(java.lang.String path)
             throws java.io.IOException
Specified by:
ls in interface ConnectionPlugin
Throws:
java.io.IOException

chdir

public void chdir(java.lang.String path)
           throws java.io.IOException
Specified by:
chdir in interface ConnectionPlugin
Throws:
java.io.IOException

getAbsolutePath

public java.lang.String getAbsolutePath()
Specified by:
getAbsolutePath in interface ConnectionPlugin

exists

public boolean exists(java.lang.String path)
Specified by:
exists in interface ConnectionPlugin

put

public void put(java.io.InputStream instream,
                java.lang.String remoteFileName)
         throws java.io.IOException
Specified by:
put in interface ConnectionPlugin
Throws:
java.io.IOException

get

public void get(java.lang.String remoteFileName,
                java.io.OutputStream outstream)
         throws java.io.IOException
Specified by:
get in interface ConnectionPlugin
Throws:
java.io.IOException

mkdir

public void mkdir(java.lang.String dir)
           throws java.io.IOException
Specified by:
mkdir in interface ConnectionPlugin
Throws:
java.io.IOException

mkdirs

public void mkdirs(java.lang.String dir)
            throws java.io.IOException
Specified by:
mkdirs in interface ConnectionPlugin
Throws:
java.io.IOException

pwd

public java.lang.String pwd()
Specified by:
pwd in interface ConnectionPlugin

remove

public void remove(java.lang.String file)
            throws java.io.IOException
Specified by:
remove in interface ConnectionPlugin
Throws:
java.io.IOException

rmdir

public void rmdir(java.lang.String dir)
           throws java.io.IOException
Specified by:
rmdir in interface ConnectionPlugin
Throws:
java.io.IOException

abort

public void abort()
           throws java.io.IOException
Specified by:
abort in interface ConnectionPlugin
Throws:
java.io.IOException

rename

public void rename(java.lang.String oldpath,
                   java.lang.String newpath)
            throws java.io.IOException
Specified by:
rename in interface ConnectionPlugin
Throws:
java.io.IOException

setModificationTime

public void setModificationTime(java.lang.String file,
                                long mtime)
                         throws java.io.IOException
Specified by:
setModificationTime in interface ConnectionPlugin
Throws:
java.io.IOException

setPermissions

public void setPermissions(java.lang.String file,
                           int permissions)
                    throws java.io.IOException
Specified by:
setPermissions in interface ConnectionPlugin
Throws:
java.io.IOException

isLink

public boolean isLink(java.lang.String path)
               throws java.io.IOException
Specified by:
isLink in interface ConnectionPlugin
Throws:
java.io.IOException

isFile

public boolean isFile(java.lang.String path)
               throws java.io.IOException
Specified by:
isFile in interface ConnectionPlugin
Throws:
java.io.IOException

getConnectionID

public int getConnectionID()
Description copied from interface: ConnectionPlugin
unique id of the connection plugin

Specified by:
getConnectionID in interface ConnectionPlugin

hasConnectionOptions

public boolean hasConnectionOptions()
Description copied from interface: ConnectionPlugin
if plugin provides additional options it will return true

Specified by:
hasConnectionOptions in interface ConnectionPlugin

getConnectionOptionPanel

public PluginOptionPanel getConnectionOptionPanel()
Description copied from interface: ConnectionPlugin
returns a PluginOptionPanel with specific options for this plugin or null if the plugin does not provide options

Specified by:
getConnectionOptionPanel in interface ConnectionPlugin

requiresPassword

public boolean requiresPassword()
Description copied from interface: ConnectionPlugin
returns true whether the user needs to enter a password considering the current plugin settings

Specified by:
requiresPassword in interface ConnectionPlugin

getProtocolString

public java.lang.String getProtocolString()
Specified by:
getProtocolString in interface ConnectionPlugin

requiresPort

public boolean requiresPort()
Specified by:
requiresPort in interface ConnectionPlugin

getDefaultPort

public int getDefaultPort()
Specified by:
getDefaultPort in interface ConnectionPlugin

isProvided

public boolean isProvided(int feature)
Description copied from interface: GeneralPlugin
plug-in must provide information if a feature is provided or not

Specified by:
isProvided in interface GeneralPlugin

getName

public java.lang.String getName()
Specified by:
getName in interface GeneralPlugin
Returns:
returns name of plug-in

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface GeneralPlugin
Returns:
returns a more detailed description of the plug-in

getVersionString

public java.lang.String getVersionString()

getMajorVersion

public int getMajorVersion()
Specified by:
getMajorVersion in interface GeneralPlugin

getMinorVersion

public int getMinorVersion()
Specified by:
getMinorVersion in interface GeneralPlugin

getLicense

public java.lang.String getLicense()
Specified by:
getLicense in interface GeneralPlugin

invokeWorkerThreadAndWait

protected java.lang.Object invokeWorkerThreadAndWait(java.lang.String methodName,
                                                     java.lang.Class[] paramClasses,
                                                     java.lang.Object[] params)

invokeTaskThrowingIOException

protected java.lang.Object invokeTaskThrowingIOException(java.lang.String methodName,
                                                         java.lang.Class[] paramClasses,
                                                         java.lang.Object[] params)
                                                  throws java.io.IOException
Throws:
java.io.IOException

setHidden

public void setHidden(java.lang.String path)
               throws java.io.IOException
Specified by:
setHidden in interface ConnectionPlugin
Throws:
java.io.IOException