How to override getVirtualUserDir() in Apache Mina sshd-core version 0.14.0

喜你入骨 提交于 2019-11-29 08:22:08

The purpose of the getVirtualUserDir in Mina SSHD 0.10.0 was to set an initial directory of the file system.

In Mina SSHD 0.14.0 the same purpose is served by current parameter of NativeFileSystemView constructor:

public NativeFileSystemView(String userName, Map<String, String> roots, String current)

Note that the documentation claims not to call the constructor directly and use NativeFileSystemFactory instead. But the NativeFileSystemFactory never calls that overload of the constructor. Either the comment is obsolete or the factory is not finished yet.

Or it's a typo and it should have actually referred to VirtualFileSystemFactory. What is the factory you probably should use instead of overriding NativeFileSystemFactory.

sshd.setFileSystemFactory(new VirtualFileSystemFactory("C:/root"));
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!