public static function build(ServerInterface $server)
    {
        if ($server instanceof SftpServer) {
            return new SftpDirectory($server);
        } elseif ($server instanceof FtpServer || $server instanceof SslServer) {
            return new FtpDirectory($server);
        } else {
            throw new \InvalidArgumentException('The argument is must instance of server class');
        }
    }