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

fixes #336 by adding getClient() & getUrl() #344

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
* The main starting point for interacting with a Jenkins server.
*/
public class JenkinsServer implements Closeable {

private static final String DEFAULT_VIEW_NAME = "all";

private final Logger LOGGER = LoggerFactory.getLogger(getClass());

/**
Expand Down Expand Up @@ -117,6 +120,27 @@ public JenkinsVersion getVersion() {
return jv;
}

/**
* Get the HTTP client.
* @return client
*/
public JenkinsHttpConnection getClient() {
return client;
}

/**
* @return the base base URL for this server; null if the URL can not be
* determined.
*/
public String getUrl() {
try {
return getView(DEFAULT_VIEW_NAME).getUrl();
} catch (IOException e) {
// is that what we want? Or should we just throw the IOException?
return null;
}
}

/**
* Get a list of all the defined jobs on the server (at the summary level)
*
Expand Down