From 5b6367a591b324b018aef8e3483850289e928944 Mon Sep 17 00:00:00 2001 From: Łukasz Gładek Date: Fri, 9 Mar 2012 13:56:41 +0000 Subject: [PATCH] searchIssuesByProject changed --- pom.xml | 17 +++++++++-------- src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java | 15 ++++++++++++--- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/pom.xml b/pom.xml index 538fde4..ea57686 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,11 @@ - + 4.0.0 pl.com.it-crowd youtrack-rest-api - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT @@ -65,12 +66,12 @@ - - release - - true - - + + release + + true + + diff --git a/src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java b/src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java index 9ef02d5..81fd878 100644 --- a/src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java +++ b/src/main/java/pl/com/it_crowd/youtrack/api/YoutrackAPI.java @@ -19,9 +19,13 @@ import java.net.URL; import java.util.ArrayList; import java.util.List; +import java.security.GeneralSecurityException; + public class YoutrackAPI { // ------------------------------ FIELDS ------------------------------ + private Integer MAX_RESULTS = 1000; + private String serviceLocation; private WebClient webClient; @@ -34,6 +38,11 @@ public class YoutrackAPI { this.webClient = new WebClient(BrowserVersion.FIREFOX_3_6); this.webClient.setJavaScriptEnabled(false); this.webClient.setCssEnabled(false); + try { + this.webClient.setUseInsecureSSL(true); + } catch (GeneralSecurityException e) { + e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + } } public YoutrackAPI(String serviceLocation, String username, String password) throws IOException, AuthenticationException @@ -71,11 +80,11 @@ public class YoutrackAPI { } } - public List searchIssuesByProject(String project, String filter) throws JAXBException, IOException + public List searchIssuesByProject(String project) throws JAXBException, IOException { - String url = serviceLocation + "/rest/issue/byproject/" + project + "?filter=" + filter; + String url = serviceLocation + "/rest/issue/byproject/" + project + "?max=" + MAX_RESULTS; WebResponse webResponse = webClient.getPage(url).getWebResponse(); -// System.out.println(webResponse.getContentAsString()); + List issues = IssuesUnmarshaller.unmarshal(webResponse.getContentAsStream()).getIssue(); List result = new ArrayList(); for (Issues.Issue issue : issues) { -- libgit2 0.24.0