sshwrap - Jsch Wrapper

Convenience API to make Jsch easier to use

Лицензия

Лицензия

Группа

Группа

org.commonjava.sshwrap
Идентификатор

Идентификатор

sshwrap
Последняя версия

Последняя версия

0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

sshwrap - Jsch Wrapper
Convenience API to make Jsch easier to use
Система контроля версий

Система контроля версий

http://github.com/jdcasey/sshwrap

Скачать sshwrap

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.commonjava.sshwrap/sshwrap/ -->
<dependency>
    <groupId>org.commonjava.sshwrap</groupId>
    <artifactId>sshwrap</artifactId>
    <version>0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.commonjava.sshwrap/sshwrap/
implementation 'org.commonjava.sshwrap:sshwrap:0.2'
// https://jarcasting.com/artifacts/org.commonjava.sshwrap/sshwrap/
implementation ("org.commonjava.sshwrap:sshwrap:0.2")
'org.commonjava.sshwrap:sshwrap:jar:0.2'
<dependency org="org.commonjava.sshwrap" name="sshwrap" rev="0.2">
  <artifact name="sshwrap" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.commonjava.sshwrap', module='sshwrap', version='0.2')
)
libraryDependencies += "org.commonjava.sshwrap" % "sshwrap" % "0.2"
[org.commonjava.sshwrap/sshwrap "0.2"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
log4j : log4j jar 1.2.12
com.jcraft : jsch jar 0.1.42
commons-lang : commons-lang jar 2.5
commons-io : commons-io jar 1.4

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.8.1

Модули Проекта

Данный проект не имеет модулей.

SSHWrap - Convenience API for Jsch

SSHWrap is designed to provide a minimal set of classes that allow you streamlined access to the features of the Jsch Java SSH client library.

Usage

Imagine that you need to create and initialize a bare remote Git repository for a project you're about to push. The following method will do the trick:

private boolean createRemoteGitRepo( final String dir )
    throws IOException, SSHWrapException
{
    SSHConnection ssh = new SSHConnection( USER, HOST, PORT ).connect();

    final Set<String> cmds = new HashSet<String>();
    cmds.add( "mkdir -p " + dir );
    cmds.add( "git --git-dir=" + dir + " --bare init" );

    final ByteArrayOutputStream cmdOutput = new ByteArrayOutputStream();

    for ( final String cmd : cmds )
    {
        cmdOutput.reset();
        final int result = ssh.execute( cmd, cmdOutput );

        if ( LOGGER.isDebugEnabled() )
        {
            LOGGER.debug( new String( cmdOutput.toByteArray() ) );
        }

        if ( result != 0 )
        {
            return false;
        }
    }

    return true;
}

Версии библиотеки

Версия
0.2