Added some features required to integrate sshj with Joval's remote jSAF provider.

1) Added boolean Channel.isEOF() method, for checking whether the server has sent EOF.
2) Added SFTP response constants to the Response enumeration
3) Spelling correction for the SYMLINK FileMode enum constant
This commit is contained in:
David Solin
2016-08-26 13:02:16 -05:00
parent 7b8b1cfdf5
commit 71498ad961
4 changed files with 38 additions and 2 deletions

View File

@@ -52,6 +52,8 @@ public abstract class AbstractChannel
/** Remote recipient ID */
private int recipient;
private boolean eof = false;
private final Queue<Event<ConnectionException>> chanReqResponseEvents = new LinkedList<Event<ConnectionException>>();
/* The lock used by to create the open & close events */
@@ -191,6 +193,11 @@ public abstract class AbstractChannel
}
}
@Override
public boolean isEOF() {
return eof;
}
@Override
public LoggerFactory getLoggerFactory() {
return loggerFactory;
@@ -394,6 +401,7 @@ public abstract class AbstractChannel
/** Called when EOF has been received. Subclasses can override but must call super. */
protected void eofInputStreams() {
in.eof();
eof = true;
}
@Override

View File

@@ -135,6 +135,11 @@ public interface Channel
void join(long timeout, TimeUnit unit)
throws ConnectionException;
/**
* Returns whether EOF has been received.
*/
boolean isEOF();
/**
* Get the LoggerFactory associated with the SSH client.
*/

View File

@@ -36,7 +36,7 @@ public class FileMode {
/** directory */
DIRECTORY(0040000),
/** symbolic link */
SYMKLINK(0120000),
SYMLINK(0120000),
/** unknown */
UNKNOWN(0);

View File

@@ -30,7 +30,30 @@ public final class Response
BAD_MESSAGE(5),
NO_CONNECTION(6),
CONNECITON_LOST(7),
OP_UNSUPPORTED(8);
OP_UNSUPPORTED(8),
INVALID_HANDLE(9),
NO_SUCH_PATH(10),
FILE_ALREADY_EXISTS(11),
WRITE_PROTECT(12),
NO_MEDIA(13),
NO_SPACE_ON_FILESYSTEM(14),
QUOTA_EXCEEDED(15),
UNKNOWN_PRINCIPAL(16),
LOCK_CONFLICT(17),
DIR_NOT_EMPTY(18),
NOT_A_DIRECTORY(19),
INVALID_FILENAME(20),
LINK_LOOP(21),
CANNOT_DELETE(22),
INVALID_PARAMETER(23),
FILE_IS_A_DIRECTORY(24),
BYTE_RANGE_LOCK_CONFLICT(25),
BYTE_RANGE_LOCK_REFUSED(26),
DELETE_PENDING(27),
FILE_CORRUPT(28),
OWNER_INVALID(29),
GROUP_INVALID(30),
NO_MATCHING_BYTE_RANGE_LOCK(31);
private final int code;