diff --git a/src/main/java/net/schmizz/concurrent/Future.java b/src/main/java/net/schmizz/concurrent/Future.java index 06e00eb7..4cb68ecf 100644 --- a/src/main/java/net/schmizz/concurrent/Future.java +++ b/src/main/java/net/schmizz/concurrent/Future.java @@ -125,7 +125,7 @@ public class Future { * Wait for {@code timeout} seconds for this future's value to be set. * * @param timeout the timeout in seconds - * @param unit + * @param unit time unit * * @return the value * @@ -157,7 +157,7 @@ public class Future { } } - /** @return Whether this future has a value set, and no error waiting to pop. */ + /** @return whether this future has a value set, and no error waiting to pop. */ public boolean isSet() { lock(); try { @@ -167,7 +167,7 @@ public class Future { } } - /** @return Whether this future currently has an error set. */ + /** @return whether this future currently has an error set. */ public boolean hasError() { lock(); try { @@ -177,7 +177,7 @@ public class Future { } } - /** @return Whether this future has threads waiting on it. */ + /** @return whether this future has threads waiting on it. */ public boolean hasWaiters() { lock(); try { diff --git a/src/main/java/net/schmizz/sshj/SSHClient.java b/src/main/java/net/schmizz/sshj/SSHClient.java index 0dc74ba6..4dc4fefa 100644 --- a/src/main/java/net/schmizz/sshj/SSHClient.java +++ b/src/main/java/net/schmizz/sshj/SSHClient.java @@ -154,7 +154,7 @@ public class SSHClient /** * Constructor that allows specifying a {@code config} to be used. * - * @param config {@link ConfigImpl} instance + * @param config {@link Config} instance */ public SSHClient(Config config) { super(DEFAULT_PORT); @@ -367,7 +367,7 @@ public class SSHClient assert !isConnected(); } - /** @return associated {@link Connection} instance. */ + /** @return the associated {@link Connection} instance. */ public Connection getConnection() { return conn; } @@ -575,14 +575,14 @@ public class SSHClient return x11f; } - /** @return instantiated {@link SCPFileTransfer} implementation. */ + /** @return Instantiated {@link SCPFileTransfer} implementation. */ public SCPFileTransfer newSCPFileTransfer() { assert isConnected() && isAuthenticated(); return new SCPFileTransfer(this); } /** - * @return instantiated {@link SFTPClient} implementation. + * @return Instantiated {@link SFTPClient} implementation. * * @throws IOException if there is an error starting the {@code sftp} subsystem * @see StatefulSFTPClient diff --git a/src/main/java/net/schmizz/sshj/Service.java b/src/main/java/net/schmizz/sshj/Service.java index 78913540..dbf1ce66 100644 --- a/src/main/java/net/schmizz/sshj/Service.java +++ b/src/main/java/net/schmizz/sshj/Service.java @@ -20,11 +20,11 @@ import net.schmizz.sshj.common.SSHException; import net.schmizz.sshj.common.SSHPacketHandler; import net.schmizz.sshj.transport.TransportException; -/** Represents a service running on top of the SSH {@link net.schmizz.sshj.transport.Transport transport layer}. */ +/** Represents a service running on top of the SSH transport layer. */ public interface Service extends SSHPacketHandler, ErrorNotifiable { - /** @return The assigned name for this SSH service. */ + /** @return the assigned name for this SSH service. */ String getName(); /** diff --git a/src/main/java/net/schmizz/sshj/connection/Connection.java b/src/main/java/net/schmizz/sshj/connection/Connection.java index 32e9a3a7..cecbd3a8 100644 --- a/src/main/java/net/schmizz/sshj/connection/Connection.java +++ b/src/main/java/net/schmizz/sshj/connection/Connection.java @@ -27,17 +27,16 @@ import net.schmizz.sshj.transport.TransportException; public interface Connection { /** - * Attach a {@link net.schmizz.sshj.connection.channel.Channel} to this connection. A channel must be attached to - * the connection if it is to receive any channel-specific data that is received. + * Attach a {@link Channel} to this connection. A channel must be attached to the connection if it is to receive any + * channel-specific data that is received. * * @param chan */ void attach(Channel chan); /** - * Attach a {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener} to this connection, which - * will be delegated opening of any {@code CHANNEL_OPEN} packets {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener#getChannelType() - * for which it is responsible}. + * Attach a {@link ForwardedChannelOpener} to this connection, which will be delegated opening of any {@code + * CHANNEL_OPEN} packets {@link ForwardedChannelOpener#getChannelType() for which it is responsible}. * * @param opener */ @@ -51,7 +50,7 @@ public interface Connection { void forget(Channel chan); /** - * Forget an attached {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener}. + * Forget an attached {@link ForwardedChannelOpener}. * * @param handler */ @@ -80,7 +79,7 @@ public interface Connection { */ ForwardedChannelOpener get(String chanType); - /** Returns an available ID a {@link net.schmizz.sshj.connection.channel.Channel} can rightfully claim. */ + /** Returns an available ID a {@link Channel} can rightfully claim. */ int nextID(); /** @@ -88,10 +87,10 @@ public interface Connection { * * @param name request name * @param wantReply whether a reply is requested - * @param specifics {@link net.schmizz.sshj.common.SSHPacket} containing fields specific to the request + * @param specifics {@link SSHPacket} containing fields specific to the request * - * @return a {@link net.schmizz.concurrent.Future} for the reply data (in case {@code wantReply} is true) which - * allows waiting on the reply, or {@code null} if a reply is not requested. + * @return a {@link Future} for the reply data (in case {@code wantReply} is true) which allows waiting on the + * reply, or {@code null} if a reply is not requested. * * @throws TransportException if there is an error sending the request */ @@ -112,8 +111,8 @@ public interface Connection { throws TransportException; /** - * Get the maximum packet size for the local window this connection recommends to any {@link Channel}'s that ask for - * it. + * @return the maximum packet size for the local window this connection recommends to any {@link Channel}'s that ask + * for it. */ int getMaxPacketSize(); @@ -123,28 +122,25 @@ public interface Connection { */ void setMaxPacketSize(int maxPacketSize); - /** - * Get the size for the local window this connection recommends to any {@link net.schmizz.sshj.connection.channel.Channel}'s - * that ask for it. - */ + /** Get the size for the local window this connection recommends to any {@link Channel}'s that ask for it. */ int getWindowSize(); /** Set the size for the local window this connection recommends to any {@link Channel}'s that ask for it. */ void setWindowSize(int windowSize); - /** Get the associated {@link Transport}. */ + /** @return the associated {@link Transport}. */ Transport getTransport(); /** - * Get the {@code timeout} this connection uses for blocking operations and recommends to any {@link Channel other} - * {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener classes} that ask for it. + * @return the {@code timeout} this connection uses for blocking operations and recommends to any {@link Channel + * other} {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener classes} that ask for + * it. */ int getTimeout(); /** - * Set the {@code timeout} this connection uses for blocking operations and recommends to any {@link - * net.schmizz.sshj.connection.channel.Channel other} {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener - * classes} that ask for it. + * Set the {@code timeout} this connection uses for blocking operations and recommends to any {@link Channel other} + * {@link ForwardedChannelOpener classes} that ask for it. */ void setTimeout(int timeout); } \ No newline at end of file diff --git a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/AbstractForwardedChannelOpener.java b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/AbstractForwardedChannelOpener.java index ff56c077..1e78a57f 100644 --- a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/AbstractForwardedChannelOpener.java +++ b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/AbstractForwardedChannelOpener.java @@ -26,7 +26,7 @@ import org.slf4j.LoggerFactory; import java.io.IOException; -/** Base class for {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener}'s. */ +/** Base class for {@link ForwardedChannelOpener}'s. */ public abstract class AbstractForwardedChannelOpener implements ForwardedChannelOpener { diff --git a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/ConnectListener.java b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/ConnectListener.java index 91e5797d..7d047ff8 100644 --- a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/ConnectListener.java +++ b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/ConnectListener.java @@ -27,7 +27,7 @@ public interface ConnectListener { * Channel.Forwarded#confirm() confirm} or {@link Channel.Forwarded#reject(net.schmizz.sshj.connection.channel.OpenFailException.Reason, * String)} reject} that channel. * - * @param chan the {@link net.schmizz.sshj.connection.channel.Channel.Forwarded forwarded channel} + * @param chan the {@link Channel.Forwarded forwarded channel} * * @throws IOException */ diff --git a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/ForwardedChannelOpener.java b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/ForwardedChannelOpener.java index 4d48b14f..bbdc2283 100644 --- a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/ForwardedChannelOpener.java +++ b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/ForwardedChannelOpener.java @@ -28,8 +28,7 @@ public interface ForwardedChannelOpener { /** * Delegates a {@code SSH_MSG_CHANNEL_OPEN} request for the channel type claimed by this opener. * - * @param buf {@link net.schmizz.sshj.common.SSHPacket} containg the request except for the message identifier and - * channel type field + * @param buf {@link SSHPacket} containg the request except for the message identifier and channel type field */ void handleOpen(SSHPacket buf) throws ConnectionException, TransportException; diff --git a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/SocketForwardingConnectListener.java b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/SocketForwardingConnectListener.java index 71df19cd..e117500f 100644 --- a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/SocketForwardingConnectListener.java +++ b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/SocketForwardingConnectListener.java @@ -26,10 +26,7 @@ import java.io.IOException; import java.net.Socket; import java.net.SocketAddress; -/** - * A {@link net.schmizz.sshj.connection.channel.forwarded.ConnectListener} that forwards what is received over the - * channel to a socket and vice-versa. - */ +/** A {@link ConnectListener} that forwards what is received over the channel to a socket and vice-versa. */ public class SocketForwardingConnectListener implements ConnectListener { diff --git a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/X11Forwarder.java b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/X11Forwarder.java index a4939511..07f084bd 100644 --- a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/X11Forwarder.java +++ b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/X11Forwarder.java @@ -22,7 +22,7 @@ import net.schmizz.sshj.transport.TransportException; /** * Handles forwarded {@code x11} channels. The actual request to forward X11 should be made from the specific {@link - * net.schmizz.sshj.connection.channel.direct.Session}. + * Session}. */ public class X11Forwarder extends AbstractForwardedChannelOpener { diff --git a/src/main/java/net/schmizz/sshj/transport/Decoder.java b/src/main/java/net/schmizz/sshj/transport/Decoder.java index 877fc311..5fad526b 100644 --- a/src/main/java/net/schmizz/sshj/transport/Decoder.java +++ b/src/main/java/net/schmizz/sshj/transport/Decoder.java @@ -177,8 +177,7 @@ final class Decoder /** * Adds {@code len} bytes from {@code b} to the decoder buffer. When a packet has been successfully decoded, hooks - * in to {@link net.schmizz.sshj.common.SSHPacketHandler#handle} of the {@link net.schmizz.sshj.common.SSHPacketHandler} - * this decoder was initialized with. + * in to {@link SSHPacketHandler#handle} of the {@link SSHPacketHandler} this decoder was initialized with. *

* Returns the number of bytes expected in the next call in order to decode the packet length, and if the packet * length has already been decoded; to decode the payload. This number is accurate and should be taken to heart. diff --git a/src/main/java/net/schmizz/sshj/transport/KeyExchanger.java b/src/main/java/net/schmizz/sshj/transport/KeyExchanger.java index 47d497d7..cd1694b1 100644 --- a/src/main/java/net/schmizz/sshj/transport/KeyExchanger.java +++ b/src/main/java/net/schmizz/sshj/transport/KeyExchanger.java @@ -126,12 +126,12 @@ final class KeyExchanger return Arrays.copyOf(sessionID, sessionID.length); } - /** @return Whether key exchange has been completed */ + /** @return whether key exchange has been completed */ boolean isKexDone() { return done.isSet(); } - /** @return Whether key exchange is currently ongoing */ + /** @return whether key exchange is currently ongoing */ boolean isKexOngoing() { return kexOngoing.get(); } diff --git a/src/main/java/net/schmizz/sshj/transport/Transport.java b/src/main/java/net/schmizz/sshj/transport/Transport.java index da8313fe..45d62c30 100644 --- a/src/main/java/net/schmizz/sshj/transport/Transport.java +++ b/src/main/java/net/schmizz/sshj/transport/Transport.java @@ -67,15 +67,14 @@ public interface Transport /** @return the version string used by this client to identify itself to an SSH server, e.g. "SSHJ_3_0" */ String getClientVersion(); - /** @return the {@link net.schmizz.sshj.ConfigImpl} associated with this transport. */ + /** @return the {@link Config} associated with this transport. */ Config getConfig(); /** @return the timeout that is currently set for blocking operations. */ int getTimeout(); /** - * Set a timeout for method that may block, e.g. {@link #reqService(net.schmizz.sshj.Service)}, {@link - * KeyExchanger#waitForDone()}. + * Set a timeout for methods that may block. * * @param timeout the timeout in seconds */ @@ -85,10 +84,10 @@ public interface Transport void setHeartbeatInterval(int interval); - /** Returns the hostname to which this transport is connected. */ + /** @return the hostname to which this transport is connected. */ String getRemoteHost(); - /** Returns the port number on the {@link #getRemoteHost() remote host} to which this transport is connected. */ + /** @return the port number on the remote host to which this transport is connected. */ int getRemotePort(); /** @@ -102,12 +101,12 @@ public interface Transport byte[] getSessionID(); - /** Returns the currently active {@link net.schmizz.sshj.Service} instance. */ + /** @return the currently active {@link Service} instance. */ Service getService(); /** - * Request a SSH service represented by a {@link net.schmizz.sshj.Service} instance. A separate call to {@link - * #setService} is not needed. + * Request a SSH service represented by a {@link Service} instance. A separate call to {@link #setService} is not + * needed. * * @param service the SSH service to be requested * @@ -117,13 +116,13 @@ public interface Transport throws TransportException; /** - * Sets the currently active {@link net.schmizz.sshj.Service}. Handling of non-transport-layer packets is {@link - * net.schmizz.sshj.Service#handle delegated} to that service. + * Sets the currently active {@link Service}. Handling of non-transport-layer packets is {@link Service#handle + * delegated} to that service. *

* For this method to be successful, at least one service request via {@link #reqService} must have been successful * (not necessarily for the service being set). * - * @param service (null-ok) the {@link net.schmizz.sshj.Service} + * @param service (null-ok) the {@link Service} */ void setService(Service service); @@ -165,10 +164,7 @@ public interface Transport /** Send a disconnection packet with reason as {@link DisconnectReason#BY_APPLICATION}, and closes this transport. */ void disconnect(); - /** - * Send a disconnect packet with the given {@link net.schmizz.sshj.common.DisconnectReason reason}, and closes this - * transport. - */ + /** Send a disconnect packet with the given {@link DisconnectReason reason}, and closes this transport. */ void disconnect(DisconnectReason reason); /** @@ -183,10 +179,10 @@ public interface Transport /** * Write a packet over this transport. *

- * The {@code payload} {@link net.schmizz.sshj.common.SSHPacket} should have 5 bytes free at the beginning to avoid - * a performance penalty associated with making space for header bytes (packet length, padding length). + * The {@code payload} {@link SSHPacket} should have 5 bytes free at the beginning to avoid a performance penalty + * associated with making space for header bytes (packet length, padding length). * - * @param payload the {@link net.schmizz.sshj.common.SSHPacket} containing data to send + * @param payload the {@link SSHPacket} containing data to send * * @return sequence number of the sent packet * diff --git a/src/main/java/net/schmizz/sshj/userauth/UserAuth.java b/src/main/java/net/schmizz/sshj/userauth/UserAuth.java index 16ff4163..37f01d88 100644 --- a/src/main/java/net/schmizz/sshj/userauth/UserAuth.java +++ b/src/main/java/net/schmizz/sshj/userauth/UserAuth.java @@ -26,7 +26,7 @@ public interface UserAuth { /** * Attempt to authenticate {@code username} using each of {@code methods} in order. {@code nextService} is the - * {@link net.schmizz.sshj.Service} that will be enabled on successful authentication. + * {@link Service} that will be enabled on successful authentication. *

* Authentication fails if there are no method available, i.e. if all the method failed or there were method * available but could not be attempted because the server did not allow them. In this case, a {@code @@ -53,14 +53,14 @@ public interface UserAuth { */ String getBanner(); - /** @return Saved exceptions that might have been ignored because there were more authentication method available. */ + /** @return saved exceptions that might have been ignored because there were more authentication method available. */ Deque getSavedExceptions(); - /** @return The {@code timeout} for a method to successfully authenticate before it is abandoned. */ + /** @return the {@code timeout} for a method to successfully authenticate before it is abandoned. */ int getTimeout(); /** - * @return Whether authentication was partially successful. Some server's may be configured to require multiple + * @return whether authentication was partially successful. Some server's may be configured to require multiple * authentications; and this value will be {@code true} if at least one of the method supplied succeeded. */ boolean hadPartialSuccess(); diff --git a/src/main/java/net/schmizz/sshj/userauth/method/AuthMethod.java b/src/main/java/net/schmizz/sshj/userauth/method/AuthMethod.java index d203ac46..8c9e91b3 100644 --- a/src/main/java/net/schmizz/sshj/userauth/method/AuthMethod.java +++ b/src/main/java/net/schmizz/sshj/userauth/method/AuthMethod.java @@ -32,8 +32,8 @@ public interface AuthMethod String getName(); /** - * Initializes this {@link AuthMethod} with the {@link net.schmizz.sshj.userauth.AuthParams parameters} needed for - * authentication. This method must be called before requesting authentication with this method. + * Initializes this {@link AuthMethod} with the {@link AuthParams parameters} needed for authentication. This method + * must be called before requesting authentication with this method. */ void init(AuthParams params); diff --git a/src/main/java/net/schmizz/sshj/userauth/password/PasswordUtils.java b/src/main/java/net/schmizz/sshj/userauth/password/PasswordUtils.java index 825db16d..64c8d857 100644 --- a/src/main/java/net/schmizz/sshj/userauth/password/PasswordUtils.java +++ b/src/main/java/net/schmizz/sshj/userauth/password/PasswordUtils.java @@ -33,7 +33,7 @@ public class PasswordUtils { /** * @param password the password as a char[] * - * @return the constructed {@link net.schmizz.sshj.userauth.password.PasswordFinder} + * @return the constructed {@link PasswordFinder} */ public static PasswordFinder createOneOff(final char[] password) { if (password == null) diff --git a/src/main/java/net/schmizz/sshj/xfer/scp/SCPDownloadClient.java b/src/main/java/net/schmizz/sshj/xfer/scp/SCPDownloadClient.java index bf35522a..734689d8 100644 --- a/src/main/java/net/schmizz/sshj/xfer/scp/SCPDownloadClient.java +++ b/src/main/java/net/schmizz/sshj/xfer/scp/SCPDownloadClient.java @@ -27,7 +27,7 @@ import java.io.IOException; import java.util.LinkedList; import java.util.List; -/** Support for uploading files over a connected {@link net.schmizz.sshj.SSHClient} link using SCP. */ +/** Support for uploading files over a connected link using SCP. */ public final class SCPDownloadClient extends SCPEngine { diff --git a/src/test/java/net/schmizz/sshj/util/BufferTest.java b/src/test/java/net/schmizz/sshj/util/BufferTest.java index 5a44f4de..d6e4996d 100644 --- a/src/test/java/net/schmizz/sshj/util/BufferTest.java +++ b/src/test/java/net/schmizz/sshj/util/BufferTest.java @@ -29,13 +29,14 @@ import java.security.GeneralSecurityException; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; -/** Tests {@link net.schmizz.sshj.common.SSHPacket} functionality */ +/** Tests {@link SSHPacket} functionality */ public class BufferTest { private Buffer.PlainBuffer posBuf; private Buffer.PlainBuffer handyBuf; @Before - public void setUp() throws UnsupportedEncodingException, GeneralSecurityException { + public void setUp() + throws UnsupportedEncodingException, GeneralSecurityException { // for position test byte[] data = "Hello".getBytes("UTF-8"); posBuf = new Buffer.PlainBuffer(data); @@ -74,7 +75,8 @@ public class BufferTest { } @Test - public void testPosition() throws UnsupportedEncodingException { + public void testPosition() + throws UnsupportedEncodingException { assertEquals(5, posBuf.wpos()); assertEquals(0, posBuf.rpos()); assertEquals(5, posBuf.available());