Package com.xebialabs.overthere

Examples of com.xebialabs.overthere.ConnectionOptions


import com.xebialabs.overthere.OverthereFile;

public class GetFileInfo {

  public static void main(String[] args) throws IOException {
    ConnectionOptions options = new ConnectionOptions();
    options.set(ADDRESS, "unix-box");
    options.set(USERNAME, "demo");
    options.set(PASSWORD, "secret");
    options.set(OPERATING_SYSTEM, UNIX);
    options.set(CONNECTION_TYPE, SFTP);
    OverthereConnection connection = Overthere.getConnection("ssh", options);
    try {
      OverthereFile motd = connection.getFile("/etc/motd");
      System.out.println("Length        : " + motd.length());
      System.out.println("Last modified : " + motd.lastModified());
View Full Code Here


import com.xebialabs.overthere.OverthereFile;

public class ManipulateDirectory {

  public static void main(String[] args) throws IOException {
    ConnectionOptions options = new ConnectionOptions();
    options.set(ADDRESS, "unix-box");
    options.set(USERNAME, "demo");
    options.set(PASSWORD, "secret");
    options.set(OPERATING_SYSTEM, UNIX);
    options.set(CONNECTION_TYPE, SFTP);
    OverthereConnection connection = Overthere.getConnection("ssh", options);
    try {
      connection.execute(CmdLine.build("cp", "-r", "/var/log/apt", "/tmp/logs1"));
      OverthereFile logs1 = connection.getFile("/tmp/logs1");
      OverthereFile logs2 = connection.getFile("/tmp/logs2");
View Full Code Here

import com.xebialabs.overthere.OverthereFile;

public class WriteFile {

  public static void main(String[] args) throws IOException {
    ConnectionOptions options = new ConnectionOptions();
    options.set(ADDRESS, "unix-box");
    options.set(USERNAME, "demo");
    options.set(PASSWORD, "secret");
    options.set(OPERATING_SYSTEM, UNIX);
    options.set(CONNECTION_TYPE, SCP);
    OverthereConnection connection = Overthere.getConnection("ssh", options);
    try {
      OverthereFile motd = connection.getFile("/tmp/new-motd");
      PrintWriter w = new PrintWriter(motd.getOutputStream());
      try {
View Full Code Here

    w.write(origBytes);
    w.close();
  }

  public void start() {
    ConnectionOptions options = new ConnectionOptions();
    options.set(ConnectionOptions.USERNAME, login);
    options.set(ConnectionOptions.PASSWORD, passwd);
    options.set(ConnectionOptions.ADDRESS, host);
    options.set(ConnectionOptions.OPERATING_SYSTEM,
        OperatingSystemFamily.UNIX);
    options.set(SshConnectionBuilder.CONNECTION_TYPE, SshConnectionType.SCP);

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

  }
View Full Code Here

TOP

Related Classes of com.xebialabs.overthere.ConnectionOptions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.