mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-06 15:20:54 +03:00
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:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,7 @@ public class FileMode {
|
||||
/** directory */
|
||||
DIRECTORY(0040000),
|
||||
/** symbolic link */
|
||||
SYMKLINK(0120000),
|
||||
SYMLINK(0120000),
|
||||
/** unknown */
|
||||
UNKNOWN(0);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user