public final class ScpIoUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static Set<ClientChannelEvent> |
COMMAND_WAIT_EVENTS |
| Modifier and Type | Method and Description |
|---|---|
static String |
getExitStatusName(Integer exitStatus) |
static void |
handleCommandExitStatus(ClientSession session,
String cmd,
ClientChannel channel,
CommandStatusHandler handler,
org.slf4j.Logger log)
Invoked by the various
upload/download methods after having successfully completed the remote copy
command and (optionally) having received an exit status from the remote server. |
static void |
handleCommandExitStatus(ClientSession session,
String cmd,
Integer exitStatus,
org.slf4j.Logger log)
Invoked by the various
upload/download methods after having successfully completed the remote copy
command and (optionally) having received an exit status from the remote server |
static ChannelExec |
openCommandChannel(ClientSession session,
String cmd,
org.slf4j.Logger log) |
static String |
readLine(InputStream in,
Charset cs) |
static String |
readLine(InputStream in,
Charset cs,
boolean canEof) |
static ScpAckInfo |
sendAcknowledgedCommand(AbstractScpCommandDetails cmd,
InputStream in,
Charset csIn,
OutputStream out,
Charset csOut) |
static ScpAckInfo |
sendAcknowledgedCommand(String cmd,
InputStream in,
Charset csIn,
OutputStream out,
Charset csOut) |
static void |
writeLine(OutputStream out,
Charset cs,
String cmd) |
public static final Set<ClientChannelEvent> COMMAND_WAIT_EVENTS
public static String readLine(InputStream in, Charset cs) throws IOException
IOExceptionpublic static String readLine(InputStream in, Charset cs, boolean canEof) throws IOException
IOExceptionpublic static void writeLine(OutputStream out, Charset cs, String cmd) throws IOException
IOExceptionpublic static ScpAckInfo sendAcknowledgedCommand(AbstractScpCommandDetails cmd, InputStream in, Charset csIn, OutputStream out, Charset csOut) throws IOException
IOExceptionpublic static ScpAckInfo sendAcknowledgedCommand(String cmd, InputStream in, Charset csIn, OutputStream out, Charset csOut) throws IOException
IOExceptionpublic static ChannelExec openCommandChannel(ClientSession session, String cmd, org.slf4j.Logger log) throws IOException
IOExceptionpublic static void handleCommandExitStatus(ClientSession session, String cmd, ClientChannel channel, CommandStatusHandler handler, org.slf4j.Logger log) throws IOException
upload/download methods after having successfully completed the remote copy
command and (optionally) having received an exit status from the remote server. If no exit status received within
CoreModuleProperties.CHANNEL_CLOSE_TIMEOUT the no further action is taken. Otherwise, the exit status is
examined to ensure it is either OK or WARNING - if not, an ScpException is thrownsession - The associated ClientSessioncmd - The attempted remote copy commandchannel - The ClientChannel through which the command was sent - Note: then channel may
be in the process of being closedhandler - The CommandStatusHandler to invoke once the exit status is received. if null
then handleCommandExitStatus(ClientSession, String, Integer, Logger) is calledlog - An optional Logger to use for issuing log messages - ignored if nullIOException - If failed the commandpublic static void handleCommandExitStatus(ClientSession session, String cmd, Integer exitStatus, org.slf4j.Logger log) throws IOException
upload/download methods after having successfully completed the remote copy
command and (optionally) having received an exit status from the remote serversession - The associated ClientSessioncmd - The attempted remote copy commandexitStatus - The exit status - if null then no status was reportedlog - An optional Logger to use for issuing log messages - ignored if nullIOException - If got a an error exit statusCopyright © 2018–2021 The Apache Software Foundation. All rights reserved.