# HG changeset patch # User Carl Byington # Date 1406747391 25200 # Node ID d2b303406d63aec07a72a15d2444e1a2d7febd61 # Parent abad243cb341e76d4b9fc2dbd5d04c9a103a4d46 remove extra override annotations that generate eclipse compiler errors diff -r abad243cb341 -r d2b303406d63 src/ch/ethz/ssh2/AbstractSFTPClient.java --- a/src/ch/ethz/ssh2/AbstractSFTPClient.java Tue Jul 29 20:28:01 2014 -0700 +++ b/src/ch/ethz/ssh2/AbstractSFTPClient.java Wed Jul 30 12:09:51 2014 -0700 @@ -120,7 +120,6 @@ * * @return True if the underlying session is in open state */ - @Override public boolean isConnected() { return sess.getState() == Channel.STATE_OPEN; } @@ -133,7 +132,6 @@ * sent a close message.) However, as long as you have not called the * close() method, you are likely wasting resources. */ - @Override public void close() { sess.close(); } @@ -146,7 +144,6 @@ * @throws java.io.IOException * @see #getCharset() */ - @Override public void setCharset(String charset) throws IOException { if(charset == null) { this.charset = null; @@ -167,14 +164,12 @@ * @return The name of the charset (null if UTF-8 is used). * @see #setCharset(String) */ - @Override public String getCharset() { return charset; } public abstract SFTPFileHandle openFile(String fileName, int flags, SFTPFileAttributes attr) throws IOException; - @Override public void mkdir(String dirName, int posixPermissions) throws IOException { int req_id = generateNextRequestID(); @@ -188,7 +183,6 @@ expectStatusOKMessage(req_id); } - @Override public void rm(String fileName) throws IOException { int req_id = generateNextRequestID(); @@ -200,7 +194,6 @@ expectStatusOKMessage(req_id); } - @Override public void rmdir(String dirName) throws IOException { int req_id = generateNextRequestID(); @@ -212,7 +205,6 @@ expectStatusOKMessage(req_id); } - @Override public void mv(String oldPath, String newPath) throws IOException { int req_id = generateNextRequestID(); @@ -225,7 +217,6 @@ expectStatusOKMessage(req_id); } - @Override public String readLink(String path) throws IOException { int req_id = generateNextRequestID(); @@ -266,7 +257,6 @@ throw new SFTPException(errorMessage, errorCode); } - @Override public void setstat(String path, SFTPFileAttributes attr) throws IOException { int req_id = generateNextRequestID(); @@ -279,7 +269,6 @@ expectStatusOKMessage(req_id); } - @Override public void fsetstat(SFTPFileHandle handle, SFTPFileAttributes attr) throws IOException { int req_id = generateNextRequestID(); @@ -292,7 +281,6 @@ expectStatusOKMessage(req_id); } - @Override public void createSymlink(String src, String target) throws IOException { int req_id = generateNextRequestID(); @@ -305,7 +293,6 @@ expectStatusOKMessage(req_id); } - @Override public void createHardlink(String src, String target) throws IOException { int req_id = generateNextRequestID(); @@ -319,7 +306,6 @@ expectStatusOKMessage(req_id); } - @Override public String canonicalPath(String path) throws IOException { int req_id = generateNextRequestID(); @@ -543,7 +529,6 @@ throw new SFTPException(errorMessage, errorCode); } - @Override public void closeFile(SFTPFileHandle handle) throws IOException { while(!pendingReadQueue.isEmpty()) { this.readPendingReadStatus(); @@ -554,7 +539,6 @@ closeHandle(handle.getHandle()); } - @Override public int read(SFTPFileHandle handle, long fileOffset, byte[] dst, int dstoff, int len) throws IOException { boolean errorOccured = false; int remaining = len * parallelism; @@ -676,7 +660,6 @@ sendMessage(Packet.SSH_FXP_READ, id, tw.getBytes()); } - @Override public void write(SFTPFileHandle handle, long fileOffset, byte[] src, int srcoff, int len) throws IOException { while(len > 0) { int writeRequestLen = len; diff -r abad243cb341 -r d2b303406d63 src/ch/ethz/ssh2/Connection.java --- a/src/ch/ethz/ssh2/Connection.java Tue Jul 29 20:28:01 2014 -0700 +++ b/src/ch/ethz/ssh2/Connection.java Wed Jul 30 12:09:51 2014 -0700 @@ -12,9 +12,8 @@ import java.net.InetSocketAddress; import java.net.Socket; import java.net.SocketTimeoutException; +import java.security.KeyPair; import java.security.SecureRandom; -import java.security.KeyPair; -import java.security.PrivateKey; import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -196,7 +195,8 @@ * methods, this method is just a wrapper for it and will * disappear in future builds. */ - public synchronized boolean authenticateWithDSA(String user, String pem, String password) throws IOException { + @Deprecated + public synchronized boolean authenticateWithDSA(String user, String pem, String password) throws IOException { if(tm == null) { throw new IllegalStateException("Connection is not established!"); } @@ -804,8 +804,7 @@ if(kexTimeout > 0) { final Runnable timeoutHandler = new Runnable() { - @Override - public void run() { + public void run() { synchronized(state) { if(state.isCancelled) { return; diff -r abad243cb341 -r d2b303406d63 src/ch/ethz/ssh2/SFTPv3Client.java --- a/src/ch/ethz/ssh2/SFTPv3Client.java Tue Jul 29 20:28:01 2014 -0700 +++ b/src/ch/ethz/ssh2/SFTPv3Client.java Wed Jul 30 12:09:51 2014 -0700 @@ -119,7 +119,6 @@ this.listener = listener; } - @Override public SFTPv3FileAttributes fstat(SFTPFileHandle handle) throws IOException { int req_id = generateNextRequestID(); @@ -188,12 +187,10 @@ throw new SFTPException(errorMessage, errorCode); } - @Override public SFTPv3FileAttributes stat(String path) throws IOException { return statBoth(path, Packet.SSH_FXP_STAT); } - @Override public SFTPv3FileAttributes lstat(String path) throws IOException { return statBoth(path, Packet.SSH_FXP_LSTAT); } @@ -257,7 +254,6 @@ } } - @Override public final SFTPv3FileHandle openDirectory(String path) throws IOException { int req_id = generateNextRequestID(); @@ -299,7 +295,6 @@ * @return A Vector containing {@link SFTPv3DirectoryEntry} objects. * @throws IOException */ - @Override public List ls(String dirName) throws IOException { SFTPv3FileHandle handle = openDirectory(dirName); List result = scanDirectory(handle.getHandle()); @@ -365,12 +360,10 @@ return openFile(filename, SSH_FXF_WRITE | SSH_FXF_APPEND, new SFTPv3FileAttributes()); } - @Override public SFTPv3FileHandle createFile(String filename) throws IOException { return createFile(filename, new SFTPv3FileAttributes()); } - @Override public SFTPv3FileHandle createFile(String filename, SFTPFileAttributes attr) throws IOException { return openFile(filename, SSH_FXF_CREAT | SSH_FXF_READ | SSH_FXF_WRITE, attr); } @@ -405,7 +398,6 @@ return openFile(filename, SSH_FXF_CREAT | SSH_FXF_TRUNC | SSH_FXF_WRITE, attr); } - @Override public SFTPv3FileHandle openFile(String filename, int flags) throws IOException { return openFile(filename, flags, new SFTPv3FileAttributes()); } diff -r abad243cb341 -r d2b303406d63 src/ch/ethz/ssh2/SFTPv3DirectoryEntry.java --- a/src/ch/ethz/ssh2/SFTPv3DirectoryEntry.java Tue Jul 29 20:28:01 2014 -0700 +++ b/src/ch/ethz/ssh2/SFTPv3DirectoryEntry.java Wed Jul 30 12:09:51 2014 -0700 @@ -37,12 +37,10 @@ */ public SFTPv3FileAttributes attributes; - @Override public String getFilename() { return filename; } - @Override public SFTPv3FileAttributes getAttributes() { return attributes; } diff -r abad243cb341 -r d2b303406d63 src/ch/ethz/ssh2/SFTPv3FileAttributes.java --- a/src/ch/ethz/ssh2/SFTPv3FileAttributes.java Tue Jul 29 20:28:01 2014 -0700 +++ b/src/ch/ethz/ssh2/SFTPv3FileAttributes.java Wed Jul 30 12:09:51 2014 -0700 @@ -88,7 +88,6 @@ * @return Returns true if permissions are available and they indicate * that this entry represents a directory. */ - @Override public boolean isDirectory() { if(permissions == null) { return false; @@ -102,7 +101,6 @@ * @return Returns true if permissions are available and they indicate * that this entry represents a regular file. */ - @Override public boolean isRegularFile() { if(permissions == null) { return false; @@ -116,7 +114,6 @@ * @return Returns true if permissions are available and they indicate * that this entry represents a symlink. */ - @Override public boolean isSymlink() { if(permissions == null) { return false; @@ -215,7 +212,6 @@ * * @return Encoded attributes */ - @Override public byte[] toBytes() { TypesWriter tw = new TypesWriter(); int attrFlags = 0; diff -r abad243cb341 -r d2b303406d63 src/ch/ethz/ssh2/SFTPv6Client.java --- a/src/ch/ethz/ssh2/SFTPv6Client.java Tue Jul 29 20:28:01 2014 -0700 +++ b/src/ch/ethz/ssh2/SFTPv6Client.java Wed Jul 30 12:09:51 2014 -0700 @@ -37,7 +37,6 @@ this.listener = listener; } - @Override public SFTPv6FileAttributes fstat(SFTPFileHandle handle) throws IOException { int req_id = generateNextRequestID(); @@ -106,12 +105,10 @@ throw new SFTPException(errorMessage, errorCode); } - @Override public SFTPv6FileAttributes stat(String path) throws IOException { return statBoth(path, Packet.SSH_FXP_STAT); } - @Override public SFTPv6FileAttributes lstat(String path) throws IOException { return statBoth(path, Packet.SSH_FXP_LSTAT); } @@ -169,7 +166,6 @@ } } - @Override public final SFTPFileHandle openDirectory(String path) throws IOException { int req_id = generateNextRequestID(); @@ -211,7 +207,6 @@ * @return A Vector containing {@link SFTPv6DirectoryEntry} objects. * @throws IOException */ - @Override public List ls(String dirName) throws IOException { SFTPFileHandle handle = openDirectory(dirName); List result = scanDirectory(handle.getHandle()); @@ -227,7 +222,6 @@ * @return a SFTPFileHandle handle * @throws IOException */ - @Override public SFTPFileHandle createFile(String filename) throws IOException { return createFile(filename, new SFTPv6FileAttributes()); } @@ -246,12 +240,10 @@ * @return a SFTPFileHandle handle * @throws IOException */ - @Override public SFTPFileHandle createFile(String filename, SFTPFileAttributes attr) throws IOException { return openFile(filename, OpenFlags.SSH_FXF_CREATE_NEW, attr); } - @Override public SFTPFileHandle openFile(String filename, int flags) throws IOException { return this.openFile(filename, flags, new SFTPv6FileAttributes()); } diff -r abad243cb341 -r d2b303406d63 src/ch/ethz/ssh2/SFTPv6FileAttributes.java --- a/src/ch/ethz/ssh2/SFTPv6FileAttributes.java Tue Jul 29 20:28:01 2014 -0700 +++ b/src/ch/ethz/ssh2/SFTPv6FileAttributes.java Wed Jul 30 12:09:51 2014 -0700 @@ -115,7 +115,6 @@ * @return Returns true if permissions are available and they indicate * that this entry represents a directory. */ - @Override public boolean isDirectory() { return (type & AttribTypes.SSH_FILEXFER_TYPE_DIRECTORY) == AttribTypes.SSH_FILEXFER_TYPE_DIRECTORY; } @@ -126,7 +125,6 @@ * @return Returns true if permissions are available and they indicate * that this entry represents a regular file. */ - @Override public boolean isRegularFile() { return (type & AttribTypes.SSH_FILEXFER_TYPE_REGULAR) == AttribTypes.SSH_FILEXFER_TYPE_REGULAR; } @@ -137,7 +135,6 @@ * @return Returns true if permissions are available and they indicate * that this entry represents a symlink. */ - @Override public boolean isSymlink() { return (type & AttribTypes.SSH_FILEXFER_TYPE_SYMLINK) == AttribTypes.SSH_FILEXFER_TYPE_SYMLINK; } @@ -264,7 +261,6 @@ * * @return Encoded attributes */ - @Override public byte[] toBytes() { TypesWriter tw = new TypesWriter(); // The 'valid-attribute-flags' specifies which of the fields are present. Those fields diff -r abad243cb341 -r d2b303406d63 src/ch/ethz/ssh2/auth/AuthenticationManager.java --- a/src/ch/ethz/ssh2/auth/AuthenticationManager.java Tue Jul 29 20:28:01 2014 -0700 +++ b/src/ch/ethz/ssh2/auth/AuthenticationManager.java Wed Jul 30 12:09:51 2014 -0700 @@ -418,12 +418,10 @@ } } - @Override public void handleFailure(final IOException failure) { connectionClosed = true; } - @Override public void handleMessage(byte[] message) throws IOException { packets.add(message); } diff -r abad243cb341 -r d2b303406d63 src/ch/ethz/ssh2/auth/ServerAuthenticationManager.java --- a/src/ch/ethz/ssh2/auth/ServerAuthenticationManager.java Tue Jul 29 20:28:01 2014 -0700 +++ b/src/ch/ethz/ssh2/auth/ServerAuthenticationManager.java Wed Jul 30 12:09:51 2014 -0700 @@ -54,12 +54,10 @@ } } - @Override public void handleFailure(final IOException failure) { // } - @Override public void handleMessage(byte[] msg) throws IOException { /* Ignore all authentication messages after successful auth */ diff -r abad243cb341 -r d2b303406d63 src/ch/ethz/ssh2/channel/ChannelManager.java --- a/src/ch/ethz/ssh2/channel/ChannelManager.java Tue Jul 29 20:28:01 2014 -0700 +++ b/src/ch/ethz/ssh2/channel/ChannelManager.java Wed Jul 30 12:09:51 2014 -0700 @@ -21,7 +21,23 @@ import ch.ethz.ssh2.ServerConnectionCallback; import ch.ethz.ssh2.ServerSessionCallback; import ch.ethz.ssh2.log.Logger; -import ch.ethz.ssh2.packets.*; +import ch.ethz.ssh2.packets.PacketChannelAuthAgentReq; +import ch.ethz.ssh2.packets.PacketChannelFailure; +import ch.ethz.ssh2.packets.PacketChannelOpenConfirmation; +import ch.ethz.ssh2.packets.PacketChannelOpenFailure; +import ch.ethz.ssh2.packets.PacketChannelSuccess; +import ch.ethz.ssh2.packets.PacketGlobalCancelForwardRequest; +import ch.ethz.ssh2.packets.PacketGlobalForwardRequest; +import ch.ethz.ssh2.packets.PacketOpenDirectTCPIPChannel; +import ch.ethz.ssh2.packets.PacketOpenSessionChannel; +import ch.ethz.ssh2.packets.PacketSessionExecCommand; +import ch.ethz.ssh2.packets.PacketSessionPtyRequest; +import ch.ethz.ssh2.packets.PacketSessionStartShell; +import ch.ethz.ssh2.packets.PacketSessionSubsystemRequest; +import ch.ethz.ssh2.packets.PacketSessionX11Request; +import ch.ethz.ssh2.packets.PacketWindowChange; +import ch.ethz.ssh2.packets.Packets; +import ch.ethz.ssh2.packets.TypesReader; import ch.ethz.ssh2.server.ServerConnectionState; import ch.ethz.ssh2.transport.MessageHandler; import ch.ethz.ssh2.transport.TransportManager; @@ -1604,7 +1620,6 @@ log.debug("Got SSH_MSG_REQUEST_FAILURE"); } - @Override public void handleFailure(final IOException failure) { log.debug("HandleMessage: got shutdown"); diff -r abad243cb341 -r d2b303406d63 src/ch/ethz/ssh2/transport/ClientKexManager.java --- a/src/ch/ethz/ssh2/transport/ClientKexManager.java Tue Jul 29 20:28:01 2014 -0700 +++ b/src/ch/ethz/ssh2/transport/ClientKexManager.java Wed Jul 30 12:09:51 2014 -0700 @@ -7,6 +7,9 @@ import java.io.IOException; import java.security.DigestException; import java.security.SecureRandom; +import java.security.interfaces.DSAPublicKey; +import java.security.interfaces.ECPublicKey; +import java.security.interfaces.RSAPublicKey; import ch.ethz.ssh2.ConnectionInfo; import ch.ethz.ssh2.PacketTypeException; @@ -28,9 +31,6 @@ import ch.ethz.ssh2.packets.PacketKexDhGexRequestOld; import ch.ethz.ssh2.packets.PacketKexInit; import ch.ethz.ssh2.packets.Packets; -import java.security.interfaces.DSAPublicKey; -import java.security.interfaces.ECPublicKey; -import java.security.interfaces.RSAPublicKey; import ch.ethz.ssh2.signature.DSASHA1Verify; import ch.ethz.ssh2.signature.ECDSASHA2Verify; import ch.ethz.ssh2.signature.RSASHA1Verify; @@ -83,7 +83,6 @@ throw new IOException("Unknown server host key algorithm '" + kxs.np.server_host_key_algo + "'"); } - @Override public void handleFailure(final IOException failure) { synchronized(accessLock) { connectionClosed = true; @@ -91,7 +90,6 @@ } } - @Override public synchronized void handleMessage(byte[] msg) throws IOException { PacketKexInit kip; diff -r abad243cb341 -r d2b303406d63 src/ch/ethz/ssh2/transport/ServerKexManager.java --- a/src/ch/ethz/ssh2/transport/ServerKexManager.java Tue Jul 29 20:28:01 2014 -0700 +++ b/src/ch/ethz/ssh2/transport/ServerKexManager.java Wed Jul 30 12:09:51 2014 -0700 @@ -6,15 +6,13 @@ import java.io.IOException; import java.security.DigestException; -import java.security.KeyPair; -import java.security.PublicKey; -import java.security.SecureRandom; import java.security.interfaces.DSAPrivateKey; import java.security.interfaces.DSAPublicKey; import java.security.interfaces.ECPrivateKey; import java.security.interfaces.ECPublicKey; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; + import ch.ethz.ssh2.ConnectionInfo; import ch.ethz.ssh2.PacketTypeException; import ch.ethz.ssh2.auth.ServerAuthenticationManager; @@ -45,7 +43,6 @@ this.state = state; } - @Override public void handleFailure(final IOException failure) { synchronized(accessLock) { connectionClosed = true; @@ -53,7 +50,6 @@ } } - @Override public void handleMessage(byte[] msg) throws IOException { PacketKexInit kip; diff -r abad243cb341 -r d2b303406d63 src/ch/ethz/ssh2/transport/TransportManager.java --- a/src/ch/ethz/ssh2/transport/TransportManager.java Tue Jul 29 20:28:01 2014 -0700 +++ b/src/ch/ethz/ssh2/transport/TransportManager.java Wed Jul 30 12:09:51 2014 -0700 @@ -7,12 +7,8 @@ import java.io.IOException; import java.io.InterruptedIOException; +import java.net.Socket; import java.security.KeyPair; -import java.security.PrivateKey; -import java.security.interfaces.DSAPrivateKey; -import java.security.interfaces.ECPrivateKey; -import java.security.interfaces.RSAPrivateKey; -import java.net.Socket; import java.util.ArrayList; import java.util.List; @@ -79,7 +75,6 @@ } private final class AsynchronousWorker implements Runnable { - @Override public void run() { while(true) { final AsynchronousEntry item;