[SSHD-694] Updated documentation in some classes
Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/c334fd65 Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/c334fd65 Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/c334fd65 Branch: refs/heads/master Commit: c334fd65712b9de76efec00584c396fce57b36f6 Parents: 3453416 Author: Lyor Goldstein <[email protected]> Authored: Thu Sep 15 19:03:26 2016 +0300 Committer: Lyor Goldstein <[email protected]> Committed: Thu Sep 15 19:03:26 2016 +0300 ---------------------------------------------------------------------- .../org/apache/sshd/agent/local/AgentForwardedChannel.java | 1 - .../channel/exit/ExitSignalChannelRequestHandler.java | 2 +- .../channel/exit/ExitStatusChannelRequestHandler.java | 2 +- .../config/hosts/DefaultConfigFileHostEntryResolver.java | 2 -- .../extensions/helpers/CheckFileHandleExtensionImpl.java | 3 +++ .../sftp/extensions/helpers/CheckFileNameExtensionImpl.java | 3 +++ .../sftp/extensions/helpers/CopyDataExtensionImpl.java | 3 +++ .../sftp/extensions/helpers/CopyFileExtensionImpl.java | 3 +++ .../sftp/extensions/helpers/MD5FileExtensionImpl.java | 3 +++ .../sftp/extensions/helpers/MD5HandleExtensionImpl.java | 3 +++ .../extensions/helpers/SpaceAvailableExtensionImpl.java | 3 +++ .../common/file/virtualfs/VirtualFileSystemFactory.java | 9 +++++---- .../org/apache/sshd/common/io/IoServiceFactoryFactory.java | 2 +- .../org/apache/sshd/server/ServerAuthenticationManager.java | 2 +- .../src/main/java/org/apache/sshd/server/SshServer.java | 2 +- .../src/test/java/org/apache/sshd/client/ClientTest.java | 2 +- .../extensions/helpers/SpaceAvailableExtensionImplTest.java | 4 ++-- .../extensions/openssh/helpers/OpenSSHExtensionsTest.java | 4 ++-- .../org/apache/sshd/server/subsystem/sftp/SshFsMounter.java | 7 +++---- .../java/org/apache/sshd/git/pack/GitPackCommandTest.java | 4 ++-- .../java/org/apache/sshd/git/pgm/GitPgmCommandTest.java | 4 ++-- 21 files changed, 43 insertions(+), 25 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/agent/local/AgentForwardedChannel.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/agent/local/AgentForwardedChannel.java b/sshd-core/src/main/java/org/apache/sshd/agent/local/AgentForwardedChannel.java index 29d70f2..9a33990 100644 --- a/sshd-core/src/main/java/org/apache/sshd/agent/local/AgentForwardedChannel.java +++ b/sshd-core/src/main/java/org/apache/sshd/agent/local/AgentForwardedChannel.java @@ -115,5 +115,4 @@ public class AgentForwardedChannel extends AbstractClientChannel { } } } - } http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/client/channel/exit/ExitSignalChannelRequestHandler.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/client/channel/exit/ExitSignalChannelRequestHandler.java b/sshd-core/src/main/java/org/apache/sshd/client/channel/exit/ExitSignalChannelRequestHandler.java index eac6514..6ebb7b2 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/channel/exit/ExitSignalChannelRequestHandler.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/channel/exit/ExitSignalChannelRequestHandler.java @@ -26,7 +26,7 @@ import org.apache.sshd.common.util.buffer.Buffer; /** * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> - * @see <A HREF="https://tools.ietf.org/html/rfc4254#page-15">RFC4254 section 6.10</A> + * @see <A HREF="https://tools.ietf.org/html/rfc4254#section-6.10">RFC4254 section 6.10</A> */ public class ExitSignalChannelRequestHandler extends AbstractChannelExitRequestHandler<String> { public static final String NAME = "exit-signal"; http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/client/channel/exit/ExitStatusChannelRequestHandler.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/client/channel/exit/ExitStatusChannelRequestHandler.java b/sshd-core/src/main/java/org/apache/sshd/client/channel/exit/ExitStatusChannelRequestHandler.java index 407668d..39954b1 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/channel/exit/ExitStatusChannelRequestHandler.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/channel/exit/ExitStatusChannelRequestHandler.java @@ -26,7 +26,7 @@ import org.apache.sshd.common.util.buffer.Buffer; /** * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> - * @see <A HREF="https://tools.ietf.org/html/rfc4254#page-15">RFC4254 section 6.10</A> + * @see <A HREF="https://tools.ietf.org/html/rfc4254#section-6.10">RFC4254 section 6.10</A> */ public class ExitStatusChannelRequestHandler extends AbstractChannelExitRequestHandler<Integer> { public static final String NAME = "exit-status"; http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/client/config/hosts/DefaultConfigFileHostEntryResolver.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/client/config/hosts/DefaultConfigFileHostEntryResolver.java b/sshd-core/src/main/java/org/apache/sshd/client/config/hosts/DefaultConfigFileHostEntryResolver.java index 3d39b6d..174a14b 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/config/hosts/DefaultConfigFileHostEntryResolver.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/config/hosts/DefaultConfigFileHostEntryResolver.java @@ -38,7 +38,6 @@ import org.apache.sshd.common.util.io.IoUtils; * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> */ public class DefaultConfigFileHostEntryResolver extends ConfigFileHostEntryResolver { - /** * The default instance that enforces the same permissions regime as {@code OpenSSH} */ @@ -93,5 +92,4 @@ public class DefaultConfigFileHostEntryResolver extends ConfigFileHostEntryResol return super.reloadHostConfigEntries(path, host, port, username); } - } http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CheckFileHandleExtensionImpl.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CheckFileHandleExtensionImpl.java b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CheckFileHandleExtensionImpl.java index 4fba6a1..65e6b54 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CheckFileHandleExtensionImpl.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CheckFileHandleExtensionImpl.java @@ -30,6 +30,9 @@ import org.apache.sshd.common.subsystem.sftp.SftpConstants; import org.apache.sshd.common.util.Pair; /** + * Implements "check-file-handle" extension + * + * @see <A HREF="http://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/draft-ietf-secsh-filexfer-09.txt">DRAFT 09 - section 9.1.2</A> * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> */ public class CheckFileHandleExtensionImpl extends AbstractCheckFileExtension implements CheckFileHandleExtension { http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CheckFileNameExtensionImpl.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CheckFileNameExtensionImpl.java b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CheckFileNameExtensionImpl.java index 4dffc1f..77c4af3 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CheckFileNameExtensionImpl.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CheckFileNameExtensionImpl.java @@ -29,6 +29,9 @@ import org.apache.sshd.common.subsystem.sftp.SftpConstants; import org.apache.sshd.common.util.Pair; /** + * Implements "check-file-name" extension + * + * @see <A HREF="http://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/draft-ietf-secsh-filexfer-09.txt">DRAFT 09 - section 9.1.2</A> * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> */ public class CheckFileNameExtensionImpl extends AbstractCheckFileExtension implements CheckFileNameExtension { http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CopyDataExtensionImpl.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CopyDataExtensionImpl.java b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CopyDataExtensionImpl.java index c56129f..85623b8 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CopyDataExtensionImpl.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CopyDataExtensionImpl.java @@ -31,6 +31,9 @@ import org.apache.sshd.common.util.NumberUtils; import org.apache.sshd.common.util.buffer.Buffer; /** + * Implements the "copy-data" extension + * + * @see <A HREF="http://tools.ietf.org/id/draft-ietf-secsh-filexfer-extensions-00.txt">DRFAT 00 - section 7</A> * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> */ public class CopyDataExtensionImpl extends AbstractSftpClientExtension implements CopyDataExtension { http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CopyFileExtensionImpl.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CopyFileExtensionImpl.java b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CopyFileExtensionImpl.java index 5ce5f9a..63f79e5 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CopyFileExtensionImpl.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/CopyFileExtensionImpl.java @@ -30,6 +30,9 @@ import org.apache.sshd.common.util.GenericUtils; import org.apache.sshd.common.util.buffer.Buffer; /** + * Implements the "copy-file" extension + * + * @see <A HREF="http://tools.ietf.org/id/draft-ietf-secsh-filexfer-extensions-00.txt">DRFAT 00 - section 6</A> * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> */ public class CopyFileExtensionImpl extends AbstractSftpClientExtension implements CopyFileExtension { http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/MD5FileExtensionImpl.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/MD5FileExtensionImpl.java b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/MD5FileExtensionImpl.java index ee27b4f..bc6149e 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/MD5FileExtensionImpl.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/MD5FileExtensionImpl.java @@ -28,6 +28,9 @@ import org.apache.sshd.client.subsystem.sftp.extensions.MD5FileExtension; import org.apache.sshd.common.subsystem.sftp.SftpConstants; /** + * Implements "md5-hash" extension + * + * @see <A HREF="http://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/draft-ietf-secsh-filexfer-09.txt">DRAFT 09 - section 9.1.1</A> * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> */ public class MD5FileExtensionImpl extends AbstractMD5HashExtension implements MD5FileExtension { http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/MD5HandleExtensionImpl.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/MD5HandleExtensionImpl.java b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/MD5HandleExtensionImpl.java index 5a67abd..d71edd6 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/MD5HandleExtensionImpl.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/MD5HandleExtensionImpl.java @@ -28,6 +28,9 @@ import org.apache.sshd.client.subsystem.sftp.extensions.MD5HandleExtension; import org.apache.sshd.common.subsystem.sftp.SftpConstants; /** + * Implements "md5-hash-handle" extension + * + * @see <A HREF="http://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/draft-ietf-secsh-filexfer-09.txt">DRAFT 09 - section 9.1.1</A> * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> */ public class MD5HandleExtensionImpl extends AbstractMD5HashExtension implements MD5HandleExtension { http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/SpaceAvailableExtensionImpl.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/SpaceAvailableExtensionImpl.java b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/SpaceAvailableExtensionImpl.java index 4185366..6fc0745 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/SpaceAvailableExtensionImpl.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/SpaceAvailableExtensionImpl.java @@ -31,6 +31,9 @@ import org.apache.sshd.common.subsystem.sftp.extensions.SpaceAvailableExtensionI import org.apache.sshd.common.util.buffer.Buffer; /** + * Implements "space-available" extension + * + * @see <A HREF="http://tools.ietf.org/wg/secsh/draft-ietf-secsh-filexfer/draft-ietf-secsh-filexfer-09.txt">DRAFT 09 - section 9.3</A> * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> */ public class SpaceAvailableExtensionImpl extends AbstractSftpClientExtension implements SpaceAvailableExtension { http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/common/file/virtualfs/VirtualFileSystemFactory.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/common/file/virtualfs/VirtualFileSystemFactory.java b/sshd-core/src/main/java/org/apache/sshd/common/file/virtualfs/VirtualFileSystemFactory.java index 205d170..60921c8 100644 --- a/sshd-core/src/main/java/org/apache/sshd/common/file/virtualfs/VirtualFileSystemFactory.java +++ b/sshd-core/src/main/java/org/apache/sshd/common/file/virtualfs/VirtualFileSystemFactory.java @@ -37,7 +37,7 @@ import org.apache.sshd.common.util.ValidateUtils; public class VirtualFileSystemFactory implements FileSystemFactory { private Path defaultHomeDir; - private final Map<String, Path> homeDirs = new ConcurrentHashMap<String, Path>(); + private final Map<String, Path> homeDirs = new ConcurrentHashMap<>(); public VirtualFileSystemFactory() { super(); @@ -67,7 +67,7 @@ public class VirtualFileSystemFactory implements FileSystemFactory { @Override public FileSystem createFileSystem(Session session) throws IOException { String username = session.getUsername(); - Path dir = computeRootDir(username); + Path dir = computeRootDir(session); if (dir == null) { throw new InvalidPathException(username, "Cannot resolve home directory"); } @@ -75,8 +75,9 @@ public class VirtualFileSystemFactory implements FileSystemFactory { return new RootedFileSystemProvider().newFileSystem(dir, Collections.<String, Object>emptyMap()); } - protected Path computeRootDir(String userName) throws IOException { - Path homeDir = getUserHomeDir(userName); + protected Path computeRootDir(Session session) throws IOException { + String username = session.getUsername(); + Path homeDir = getUserHomeDir(username); if (homeDir == null) { homeDir = getDefaultHomeDir(); } http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/common/io/IoServiceFactoryFactory.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/common/io/IoServiceFactoryFactory.java b/sshd-core/src/main/java/org/apache/sshd/common/io/IoServiceFactoryFactory.java index 374b3f4..47b40bb 100644 --- a/sshd-core/src/main/java/org/apache/sshd/common/io/IoServiceFactoryFactory.java +++ b/sshd-core/src/main/java/org/apache/sshd/common/io/IoServiceFactoryFactory.java @@ -21,9 +21,9 @@ package org.apache.sshd.common.io; import org.apache.sshd.common.FactoryManager; /** + * @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a> */ public interface IoServiceFactoryFactory { IoServiceFactory create(FactoryManager manager); - } http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/server/ServerAuthenticationManager.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/server/ServerAuthenticationManager.java b/sshd-core/src/main/java/org/apache/sshd/server/ServerAuthenticationManager.java index 188fd3f..e19c680 100644 --- a/sshd-core/src/main/java/org/apache/sshd/server/ServerAuthenticationManager.java +++ b/sshd-core/src/main/java/org/apache/sshd/server/ServerAuthenticationManager.java @@ -87,7 +87,7 @@ public interface ServerAuthenticationManager { * will be used as the banner contents. * </LI></P> * </UL> - * @see <A HREF="https://www.ietf.org/rfc/rfc4252.txt">RFC-4252 section 5.4</A> + * @see <A HREF="https://tools.ietf.org/html/rfc4252#section-5.4">RFC-4252 section 5.4</A> */ String WELCOME_BANNER = "welcome-banner"; http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/main/java/org/apache/sshd/server/SshServer.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/server/SshServer.java b/sshd-core/src/main/java/org/apache/sshd/server/SshServer.java index f8fcf39..b60fabd 100644 --- a/sshd-core/src/main/java/org/apache/sshd/server/SshServer.java +++ b/sshd-core/src/main/java/org/apache/sshd/server/SshServer.java @@ -601,7 +601,7 @@ public class SshServer extends AbstractFactoryManager implements ServerFactoryMa return new ProcessShellFactory(GenericUtils.split(command, ' ')).create(); } }).build()); - sshd.setSubsystemFactories(Arrays.<NamedFactory<Command>>asList(new SftpSubsystemFactory())); + sshd.setSubsystemFactories(Collections.<NamedFactory<Command>>singletonList(new SftpSubsystemFactory())); sshd.start(); Thread.sleep(Long.MAX_VALUE); http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/test/java/org/apache/sshd/client/ClientTest.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/test/java/org/apache/sshd/client/ClientTest.java b/sshd-core/src/test/java/org/apache/sshd/client/ClientTest.java index 97142f1..28d5436 100644 --- a/sshd-core/src/test/java/org/apache/sshd/client/ClientTest.java +++ b/sshd-core/src/test/java/org/apache/sshd/client/ClientTest.java @@ -444,7 +444,7 @@ public class ClientTest extends BaseTestSupport { assertSame("Mismatched closed channel instances", channel, channelHolder.getAndSet(null)); } }); - sshd.setSubsystemFactories(Arrays.<NamedFactory<Command>>asList(new SftpSubsystemFactory())); + sshd.setSubsystemFactories(Collections.<NamedFactory<Command>>singletonList(new SftpSubsystemFactory())); client.start(); http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/SpaceAvailableExtensionImplTest.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/SpaceAvailableExtensionImplTest.java b/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/SpaceAvailableExtensionImplTest.java index ef1cb61..e3f0c7f 100644 --- a/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/SpaceAvailableExtensionImplTest.java +++ b/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/extensions/helpers/SpaceAvailableExtensionImplTest.java @@ -24,7 +24,7 @@ import java.io.StreamCorruptedException; import java.nio.file.FileStore; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.concurrent.TimeUnit; @@ -68,7 +68,7 @@ public class SpaceAvailableExtensionImplTest extends AbstractSftpClientTestSuppo final SpaceAvailableExtensionInfo expected = new SpaceAvailableExtensionInfo(store); List<NamedFactory<Command>> factories = sshd.getSubsystemFactories(); - sshd.setSubsystemFactories(Arrays.<NamedFactory<Command>>asList(new SftpSubsystemFactory() { + sshd.setSubsystemFactories(Collections.<NamedFactory<Command>>singletonList(new SftpSubsystemFactory() { @Override public Command create() { return new SftpSubsystem(getExecutorService(), isShutdownOnExit(), getUnsupportedAttributePolicy()) { http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/extensions/openssh/helpers/OpenSSHExtensionsTest.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/extensions/openssh/helpers/OpenSSHExtensionsTest.java b/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/extensions/openssh/helpers/OpenSSHExtensionsTest.java index d69813e..375c846 100644 --- a/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/extensions/openssh/helpers/OpenSSHExtensionsTest.java +++ b/sshd-core/src/test/java/org/apache/sshd/client/subsystem/sftp/extensions/openssh/helpers/OpenSSHExtensionsTest.java @@ -27,7 +27,7 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; @@ -122,7 +122,7 @@ public class OpenSSHExtensionsTest extends AbstractSftpClientTestSupport { expected.f_fsid = 1L; expected.f_namemax = 256; - sshd.setSubsystemFactories(Arrays.<NamedFactory<Command>>asList(new SftpSubsystemFactory() { + sshd.setSubsystemFactories(Collections.<NamedFactory<Command>>singletonList(new SftpSubsystemFactory() { @Override public Command create() { return new SftpSubsystem(getExecutorService(), isShutdownOnExit(), getUnsupportedAttributePolicy()) { http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-core/src/test/java/org/apache/sshd/server/subsystem/sftp/SshFsMounter.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/test/java/org/apache/sshd/server/subsystem/sftp/SshFsMounter.java b/sshd-core/src/test/java/org/apache/sshd/server/subsystem/sftp/SshFsMounter.java index 35cfece..4cc9472 100644 --- a/sshd-core/src/test/java/org/apache/sshd/server/subsystem/sftp/SshFsMounter.java +++ b/sshd-core/src/test/java/org/apache/sshd/server/subsystem/sftp/SshFsMounter.java @@ -25,7 +25,6 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.PrintStream; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; @@ -82,7 +81,7 @@ public final class SshFsMounter { int numComps = GenericUtils.length(comps); cmdName = GenericUtils.trimToEmpty(ValidateUtils.checkNotNullAndNotEmpty(comps[0], "No command name")); if (numComps > 1) { - args = new ArrayList<String>(numComps - 1); + args = new ArrayList<>(numComps - 1); for (int index = 1; index < numComps; index++) { String c = GenericUtils.trimToEmpty(comps[index]); if (GenericUtils.isEmpty(c)) { @@ -245,7 +244,7 @@ public final class SshFsMounter { public static void main(String[] args) throws Exception { int port = SshConfigFileReader.DEFAULT_PORT; boolean error = false; - Map<String, String> options = new LinkedHashMap<String, String>(); + Map<String, String> options = new LinkedHashMap<>(); int numArgs = GenericUtils.length(args); for (int i = 0; i < numArgs; i++) { @@ -320,7 +319,7 @@ public final class SshFsMounter { sshd.setPasswordAuthenticator(AcceptAllPasswordAuthenticator.INSTANCE); sshd.setTcpipForwardingFilter(AcceptAllForwardingFilter.INSTANCE); sshd.setCommandFactory(new ScpCommandFactory.Builder().withDelegate(MounterCommandFactory.INSTANCE).build()); - sshd.setSubsystemFactories(Arrays.<NamedFactory<Command>>asList(new SftpSubsystemFactory())); + sshd.setSubsystemFactories(Collections.<NamedFactory<Command>>singletonList(new SftpSubsystemFactory())); sshd.start(); Thread.sleep(Long.MAX_VALUE); http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-git/src/test/java/org/apache/sshd/git/pack/GitPackCommandTest.java ---------------------------------------------------------------------- diff --git a/sshd-git/src/test/java/org/apache/sshd/git/pack/GitPackCommandTest.java b/sshd-git/src/test/java/org/apache/sshd/git/pack/GitPackCommandTest.java index be818b7..bc26a9c 100644 --- a/sshd-git/src/test/java/org/apache/sshd/git/pack/GitPackCommandTest.java +++ b/sshd-git/src/test/java/org/apache/sshd/git/pack/GitPackCommandTest.java @@ -20,7 +20,7 @@ package org.apache.sshd.git.pack; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Arrays; +import java.util.Collections; import com.jcraft.jsch.JSch; @@ -73,7 +73,7 @@ public class GitPackCommandTest extends BaseTestSupport { try (SshServer sshd = setupTestServer()) { Path serverRootDir = gitRootDir.resolve("server"); - sshd.setSubsystemFactories(Arrays.<NamedFactory<Command>>asList(new SftpSubsystemFactory())); + sshd.setSubsystemFactories(Collections.<NamedFactory<Command>>singletonList(new SftpSubsystemFactory())); sshd.setCommandFactory(new GitPackCommandFactory(Utils.resolveRelativeRemotePath(targetParent, serverRootDir))); sshd.start(); http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/c334fd65/sshd-git/src/test/java/org/apache/sshd/git/pgm/GitPgmCommandTest.java ---------------------------------------------------------------------- diff --git a/sshd-git/src/test/java/org/apache/sshd/git/pgm/GitPgmCommandTest.java b/sshd-git/src/test/java/org/apache/sshd/git/pgm/GitPgmCommandTest.java index 77c14db..1898a47 100644 --- a/sshd-git/src/test/java/org/apache/sshd/git/pgm/GitPgmCommandTest.java +++ b/sshd-git/src/test/java/org/apache/sshd/git/pgm/GitPgmCommandTest.java @@ -20,8 +20,8 @@ package org.apache.sshd.git.pgm; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.EnumSet; import java.util.concurrent.TimeUnit; @@ -60,7 +60,7 @@ public class GitPgmCommandTest extends BaseTestSupport { // try (SshServer sshd = setupTestServer()) { - sshd.setSubsystemFactories(Arrays.<NamedFactory<Command>>asList(new SftpSubsystemFactory())); + sshd.setSubsystemFactories(Collections.<NamedFactory<Command>>singletonList(new SftpSubsystemFactory())); sshd.setCommandFactory(new GitPgmCommandFactory(Utils.resolveRelativeRemotePath(targetParent, serverDir))); sshd.start();
