xebialabs / overthere

Runs something "Over there"

Home Page:http://www.xebialabs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add code examples and javadoc

Hes-Siemelink opened this issue · comments

It would be nice to have a "Hello, there!" example in the Readme.

I would also appreciate a link to the javadocs. I tried to build the javadocs locally using gradle, but something went wrong with the CSS, so it's not really readable.

Thanks,

Hes.

Here's my version of "Hello, there!"

package com.xebialabs.xlrelease.plugin.overthere;

import com.xebialabs.overthere.CmdLine;
import com.xebialabs.overthere.ConnectionOptions;
import com.xebialabs.overthere.OperatingSystemFamily;
import com.xebialabs.overthere.Overthere;
import com.xebialabs.overthere.OverthereConnection;
import com.xebialabs.overthere.ssh.SshConnectionBuilder;
import com.xebialabs.overthere.ssh.SshConnectionType;

public class HelloThere {

  public static void main(String[] args) {
    ConnectionOptions options = new ConnectionOptions();
    options.set(ConnectionOptions.USERNAME, "me");
    options.set(ConnectionOptions.PASSWORD, "my password");
    options.set(ConnectionOptions.ADDRESS, "localhost");
    options.set(ConnectionOptions.OPERATING_SYSTEM, OperatingSystemFamily.UNIX);
    options.set(SshConnectionBuilder.CONNECTION_TYPE, SshConnectionType.SCP);

    OverthereConnection connection = Overthere.getConnection(SshConnectionBuilder.SSH_PROTOCOL, options);

    CmdLine command = CmdLine.build("echo", "'Hello, There!'");
    connection.execute(command);
  }
}

Some of those examples need to be cleaned up as there are deprecated methods being used in them :(
The JavaDocs link is broken in the read page for this project :(