Class SShConnection
java.lang.Object
net.thevpc.common.ssh.SShConnection
- All Implemented Interfaces:
AutoCloseable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSShConnection(String address) SShConnection(String user, String host, int port, String keyFilePath, String keyPassword) SShConnection(SshAddress address) -
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)
-
Field Details
-
LOGGER
-
-
Constructor Details
-
SShConnection
-
SShConnection
-
SShConnection
-
-
Method Details
-
isRedirectErrorStream
public boolean isRedirectErrorStream() -
setRedirectErrorStream
-
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
-