Add code examples and javadoc
Hes-Siemelink opened this issue · comments
Hes Siemelink commented
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.
Hes Siemelink commented
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);
}
}
Jeroen van Erp commented
Hi Hes,
Have you looked at the examples sub directory? (https://github.com/xebialabs/overthere/tree/master/examples/src/main/java/com/xebialabs/overthere)
Deirdra Strangio commented
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 :(