com.sshtools.daemon.scp
Class ScpServer
java.lang.Object
com.sshtools.daemon.platform.NativeProcessProvider
com.sshtools.daemon.scp.ScpServer
- All Implemented Interfaces:
- java.lang.Runnable
public class ScpServer
- extends NativeProcessProvider
- implements java.lang.Runnable
- Version:
- $Revision: 1.1 $
- Author:
- $author$
Constructor Summary |
ScpServer()
Creates a new ScpServer object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static org.apache.commons.logging.Log log
BUFFER_SIZE
private static int BUFFER_SIZE
in
private java.io.InputStream in
err
private java.io.InputStream err
out
private java.io.OutputStream out
destination
private java.lang.String destination
pipeIn
private java.io.PipedOutputStream pipeIn
pipeErr
private java.io.PipedOutputStream pipeErr
pipeOut
private java.io.PipedInputStream pipeOut
scpServerThread
private SshThread scpServerThread
verbosity
private int verbosity
exitCode
private int exitCode
directory
private boolean directory
recursive
private boolean recursive
from
private boolean from
to
private boolean to
nfs
private NativeFileSystemProvider nfs
buffer
private byte[] buffer
currentDirectory
private java.lang.String currentDirectory
preserveAttributes
private boolean preserveAttributes
ScpServer
public ScpServer()
- Creates a new ScpServer object.
allocatePseudoTerminal
public boolean allocatePseudoTerminal(java.lang.String term,
int cols,
int rows,
int width,
int height,
java.lang.String modes)
- Specified by:
allocatePseudoTerminal
in class NativeProcessProvider
- Returns:
createProcess
public boolean createProcess(java.lang.String command,
java.util.Map environment)
throws java.io.IOException
- Specified by:
createProcess
in class NativeProcessProvider
- Returns:
-
- Throws:
java.io.IOException
getDefaultTerminalProvider
public java.lang.String getDefaultTerminalProvider()
- Specified by:
getDefaultTerminalProvider
in class NativeProcessProvider
- Returns:
getInputStream
public java.io.InputStream getInputStream()
throws java.io.IOException
- Specified by:
getInputStream
in class NativeProcessProvider
- Returns:
-
- Throws:
java.io.IOException
getStderrInputStream
public java.io.InputStream getStderrInputStream()
- Specified by:
getStderrInputStream
in class NativeProcessProvider
- Returns:
getOutputStream
public java.io.OutputStream getOutputStream()
throws java.io.IOException
- Specified by:
getOutputStream
in class NativeProcessProvider
- Returns:
-
- Throws:
java.io.IOException
kill
public void kill()
- Specified by:
kill
in class NativeProcessProvider
start
public void start()
throws java.io.IOException
- Specified by:
start
in class NativeProcessProvider
- Throws:
java.io.IOException
stillActive
public boolean stillActive()
- Specified by:
stillActive
in class NativeProcessProvider
- Returns:
supportsPseudoTerminal
public boolean supportsPseudoTerminal(java.lang.String term)
- Specified by:
supportsPseudoTerminal
in class NativeProcessProvider
- Returns:
waitForExitCode
public int waitForExitCode()
- Specified by:
waitForExitCode
in class NativeProcessProvider
- Returns:
scp
private void scp(java.lang.String args)
throws java.io.IOException
- Throws:
java.io.IOException
writeOk
private void writeOk()
throws java.io.IOException
- Send ok command to client
- Throws:
java.io.IOException
- on any error
writeCommand
private void writeCommand(java.lang.String cmd)
throws java.io.IOException
- Send command to client
- Parameters:
cmd
- command
- Throws:
java.io.IOException
- on any error
writeError
private void writeError(java.lang.String msg)
throws java.io.IOException
- Send error message to client
- Parameters:
msg
- error message
- Throws:
java.io.IOException
- on any error
writeError
private void writeError(java.lang.String msg,
boolean serious)
throws java.io.IOException
- Send error message to client
- Parameters:
msg
- error messageserious
- serious error
- Throws:
java.io.IOException
- on any error
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
writeDirToRemote
private boolean writeDirToRemote(java.lang.String path)
throws java.io.IOException
- Throws:
java.io.IOException
writeFileToRemote
private void writeFileToRemote(java.lang.String path)
throws java.io.IOException,
PermissionDeniedException,
InvalidHandleException
- Throws:
java.io.IOException
PermissionDeniedException
InvalidHandleException
waitForResponse
private void waitForResponse()
throws java.io.IOException
- Throws:
java.io.IOException
readFromRemote
private void readFromRemote(java.lang.String path)
throws java.io.IOException
- Throws:
java.io.IOException
parseCommand
private void parseCommand(java.lang.String cmd,
java.lang.String[] cmdParts)
throws java.io.IOException
- Throws:
java.io.IOException
readString
private java.lang.String readString()
throws java.io.IOException
- Throws:
java.io.IOException