diff --git a/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java b/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java index 01755baa..5eb962dc 100644 --- a/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java +++ b/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java @@ -260,6 +260,29 @@ public View getView(FolderJob folder, String name) throws IOException { } } + /** + * Get the xml description of an existing view + * + * @param viewName name of the view. + * @return the new view object + * @throws IOException in case of an error. + */ + public String getViewXml(String viewName) throws IOException { + return getJobXml(null, viewName); + } + + /** + * Get the xml description of an existing vie. + * + * @param viewName name of the view. + * @param folder {@link FolderJob} + * @return the new job object + * @throws IOException in case of an error. + */ + public String getViewXml(FolderJob folder, String viewName) throws IOException { + return client.get(UrlUtils.toJobBaseUrl(folder, viewName) + "/config.xml"); + } + /** * Get a single Job from the server. *