Class SShConnection
java.lang.Object
net.thevpc.nuts.ext.ssh.SShConnection
- All Implemented Interfaces:
AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionSShConnection(String address, InputStream in, OutputStream out, OutputStream err) SShConnection(String user, String host, int port, String keyFilePath, String keyPassword, InputStream in, OutputStream out, OutputStream err, NSession sshSession) SShConnection(NConnexionString address, InputStream in, OutputStream out, OutputStream err) -
Method Summary
Modifier and TypeMethodDescriptionaddListener(SshListener listener) static intcheckAck(InputStream in) voidclose()voidcopyLocalToRemote(String from, String to, boolean mkdirs) voidcopyRemoteToLocal(String from, String to, boolean mkdir) intintintexecStringCommand(String command) failFast()getInputStream(String from) getOut()grabOutputString(boolean grab) booleanbooleanbooleanvoidprepareStream(File file) byte[]readRemoteFile(String from) removeListener(SshListener listener) voidreset()voidsailFast(boolean failFast) setFailFast(boolean failFast) setOut(PrintStream out) setRedirectErrorStream(boolean redirectErrorStream)
-
Constructor Details
-
SShConnection
-
SShConnection
-
SShConnection
public SShConnection(String user, String host, int port, String keyFilePath, String keyPassword, InputStream in, OutputStream out, OutputStream err, NSession sshSession)
-
-
Method Details
-
isRedirectErrorStream
public boolean isRedirectErrorStream() -
redirectErrorStream
-
setRedirectErrorStream
-
reset
public void reset() -
addListener
-
removeListener
-
isFailFast
public boolean isFailFast() -
failFast
-
sailFast
-
setFailFast
-
redirectOutput
-
isGrabOutputString
public boolean isGrabOutputString() -
grabOutputString
-
grabOutputString
-
checkAck
- Throws:
IOException
-
exec
-
exec
-
execStringCommand
-
rm
-
mkdir
-
readRemoteFile
-
copyRemoteToLocal
-
getInputStream
-
copyLocalToRemote
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getOutputString
-
getOut
-
setOut
-
prepareStream
- Throws:
FileNotFoundException
-