[ 
https://issues.apache.org/jira/browse/SSHD-816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16440496#comment-16440496
 ] 

Goldstein Lyor commented on SSHD-816:
-------------------------------------

Sounds reasonable - I was thinking about also using the {{Subsystem}} command 
line property for the SSH server in order to detect sub-system(s) as follows:
{code:java}
private List<NamedFactory<Command>> resolveSubsystems(Map<String, ?> cmdArgs) {
    String clazzList = System.getProperty(SubsystemFactory.class.getName());
    if (clazzList != null) {
        // assume comma separated list of classes
       return ...;
    }

    ServiceLoader<SubsystemFactory> sl = 
ServiceLoader.load(SubsystemFactory.class);
    String nameList = Objects.toString(cmdArgs.get("Subsystem"), null);
    // assume comma-separate list of factories names
    Collection<String> namesFilter = isBlank(nameList) ? Collections.emptySet() 
: new TreeSet<>(String.CASE_INSENSITIVE_ORDER).addAll(split(names));
    boolean haveNames = !namesFilter.isEmpty();
    for (NamedFactory<Command> f : sl) {
        String factoryName = f.getName();
        if (haveNames && (!namesFilter.contains(factoryName))) {
             continue;
       }
       factories.add(f);
    }
    return factories;
}
{code}

> Provide some way for the SSHD command line server to detect and configure the 
> (split) SFTP subsystem
> ----------------------------------------------------------------------------------------------------
>
>                 Key: SSHD-816
>                 URL: https://issues.apache.org/jira/browse/SSHD-816
>             Project: MINA SSHD
>          Issue Type: Improvement
>    Affects Versions: 1.8.0
>            Reporter: Goldstein Lyor
>            Assignee: Goldstein Lyor
>            Priority: Major
>              Labels: SFTP, sftp
>
> h5. Description
> Following SSHD-815, the SFTP subsystem resides in its own module. We need to 
> figure out a way to allow the {{sshd.sh/bat}} files to provide some way to 
> add the SFTP sub-system to the server instance, configure and run it.
> h5. Implementation notes
> Consider founding {{sshd-cli}} module that depends on all the others and 
> export *all* the command line utilities from it (SFTP, SCP, SSH) and not just 
> the server.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to