All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.oneandone.iocunitejb.simulators.sftpserver.DelayedSftpSubsystemFactory Maven / Gradle / Ivy

There is a newer version: 2.0.50
Show newest version
package com.oneandone.iocunitejb.simulators.sftpserver;

import java.util.function.Consumer;

import org.apache.sshd.common.util.GenericUtils;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.subsystem.sftp.SftpEventListener;
import org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory;

/**
 * Creates {@link DelayedSftpSubsystem}s instead of {@link org.apache.sshd.server.subsystem.sftp.SftpSubsystem}s.
 */
public class DelayedSftpSubsystemFactory extends SftpSubsystemFactory {

    @Override
    public Command create() {
        DelayedSftpSubsystem subsystem = new DelayedSftpSubsystem(getExecutorService(), isShutdownOnExit(), getUnsupportedAttributePolicy());
        GenericUtils.forEach(getRegisteredListeners(), new Consumer() {
            @Override
            public void accept(SftpEventListener sftpEventListener) {
                addSftpEventListener(sftpEventListener);
            }
        });
        return subsystem;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy