Skip to content
Permalink
Browse files
Merge pull request #3 from dennisl/master
[FIXED JENKINS-7257] More verbose site name
  • Loading branch information
olamy committed Jul 1, 2011
2 parents cdb98bc + 08f5f3b commit 4162acc0c88ec7adf606aa7725e8db460c4c93b9
@@ -317,7 +317,7 @@ public FormValidation doLoginCheck(StaplerRequest request) {
if (hostname == null) {// hosts is not entered yet
return FormValidation.ok();
}
SCPSite site = new SCPSite(hostname, request.getParameter("port"),
SCPSite site = new SCPSite("", hostname, request.getParameter("port"),
request.getParameter("user"), request.getParameter("pass"),
request.getParameter("keyfile"));
try {
@@ -32,6 +32,7 @@
*
*/
public class SCPSite {
String displayname;
String hostname;
int port;
String username;
@@ -46,17 +47,19 @@ public SCPSite() {

}

public SCPSite(String hostname, int port, String username, String password,
public SCPSite(String displayname, String hostname, int port, String username, String password,
String rootRepositoryPath) {
this.displayname = displayname;
this.hostname = hostname;
this.port = port;
this.username = username;
this.password = password;
this.rootRepositoryPath = rootRepositoryPath.trim();
}

public SCPSite(String hostname, String port, String username,
public SCPSite(String displayname, String hostname, String port, String username,
String password) {
this.displayname = displayname;
this.hostname = hostname;
try {
this.port = Integer.parseInt(port);
@@ -67,9 +70,9 @@ public SCPSite(String hostname, String port, String username,
this.password = password;
}

public SCPSite(String hostname, String port, String username,
public SCPSite(String displayname, String hostname, String port, String username,
String passphrase, String keyfile) {
this(hostname, port, username, passphrase);
this(displayname, hostname, port, username, passphrase);

this.keyfile = keyfile;
}
@@ -82,6 +85,14 @@ public void setKeyfile(String keyfile) {
this.keyfile = keyfile;
}

public String getDisplayname() {
return displayname;
}

public void setDisplayname(String displayname) {
this.displayname = displayname;
}

public String getHostname() {
return hostname;
}
@@ -131,7 +142,11 @@ public void setRootRepositoryPath(String rootRepositoryPath) {
}

public String getName() {
return hostname;
if (StringUtils.isEmpty(displayname)) {
return username + "@" + hostname + ":" + rootRepositoryPath;
} else {
return displayname;
}
}

public Session createSession(PrintStream logger) throws JSchException {
@@ -5,6 +5,9 @@
description="${%SCP sites that projects will want to connect}">
<f:repeatable var="site" items="${descriptor.sites}">
<table width="100%">
<f:entry title="${%Displayname}" help="/plugin/scp/help-displayname.html">
<f:textbox name="scp.displayname" value="${site.displayname}"/>
</f:entry>
<f:entry title="${%Hostname}" help="/plugin/scp/help-hostname.html">
<f:textbox name="scp.hostname" value="${site.hostname}"/>
</f:entry>
@@ -0,0 +1 @@
<div>SCP Display Name</div>

0 comments on commit 4162acc

Please sign in to comment.