Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add code examples and javadoc #88

Closed
Hes-Siemelink opened this issue Dec 5, 2013 · 3 comments
Closed

Add code examples and javadoc #88

Hes-Siemelink opened this issue Dec 5, 2013 · 3 comments

Comments

@Hes-Siemelink
Copy link
Member

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
Copy link
Member Author

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);
  }
}

@hierynomus
Copy link
Contributor

Hi Hes,

Have you looked at the examples sub directory? (https://github.com/xebialabs/overthere/tree/master/examples/src/main/java/com/xebialabs/overthere)

@DrGirlfriend
Copy link

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 :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants