59 lines
1.2 KiB
Java
59 lines
1.2 KiB
Java
package handleSsh;
|
|
|
|
public class ServerBuilder {
|
|
private String host = null;
|
|
private String username = "unipi";
|
|
private String password = "unipi.technology";
|
|
private String path = "/home/unipi";
|
|
private int port = 22;
|
|
|
|
public ServerBuilder() { }
|
|
|
|
public Server buildServer()
|
|
{
|
|
return new Server(host, username, password, path, port);
|
|
}
|
|
|
|
|
|
public ServerBuilder host(String host)
|
|
{
|
|
this.host = host;
|
|
return this;
|
|
}
|
|
|
|
public ServerBuilder username(String username)
|
|
{
|
|
this.username = username;
|
|
return this;
|
|
}
|
|
|
|
public ServerBuilder password(String password)
|
|
{
|
|
this.password = password;
|
|
return this;
|
|
}
|
|
|
|
public ServerBuilder path(String path)
|
|
{
|
|
this.path = path;
|
|
return this;
|
|
}
|
|
|
|
public ServerBuilder port(int port)
|
|
{
|
|
this.port = port;
|
|
return this;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "ServerBuilder{" +
|
|
"host='" + host + '\'' +
|
|
", username='" + username + '\'' +
|
|
", password='" + password + '\'' +
|
|
", path='" + path + '\'' +
|
|
", port=" + port +
|
|
'}';
|
|
}
|
|
}
|
|
|