Showing
2 changed files
with
21 additions
and
11 deletions
| 1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| 2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 3 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| 3 | 4 | <modelVersion>4.0.0</modelVersion> |
| 4 | 5 | |
| 5 | 6 | <groupId>pl.com.it-crowd</groupId> |
| 6 | 7 | <artifactId>youtrack-rest-api</artifactId> |
| 7 | - <version>1.0.1-SNAPSHOT</version> | |
| 8 | + <version>1.0.2-SNAPSHOT</version> | |
| 8 | 9 | |
| 9 | 10 | <dependencies> |
| 10 | 11 | <dependency> |
| ... | ... | @@ -65,12 +66,12 @@ |
| 65 | 66 | </plugins> |
| 66 | 67 | </build> |
| 67 | 68 | </profile> |
| 68 | - <profile> | |
| 69 | - <id>release</id> | |
| 70 | - <properties> | |
| 71 | - <skipTests>true</skipTests> | |
| 72 | - </properties> | |
| 73 | - </profile> | |
| 69 | + <profile> | |
| 70 | + <id>release</id> | |
| 71 | + <properties> | |
| 72 | + <skipTests>true</skipTests> | |
| 73 | + </properties> | |
| 74 | + </profile> | |
| 74 | 75 | </profiles> |
| 75 | 76 | |
| 76 | 77 | <distributionManagement> | ... | ... |
| ... | ... | @@ -19,9 +19,13 @@ import java.net.URL; |
| 19 | 19 | import java.util.ArrayList; |
| 20 | 20 | import java.util.List; |
| 21 | 21 | |
| 22 | +import java.security.GeneralSecurityException; | |
| 23 | + | |
| 22 | 24 | public class YoutrackAPI { |
| 23 | 25 | // ------------------------------ FIELDS ------------------------------ |
| 24 | 26 | |
| 27 | + private Integer MAX_RESULTS = 1000; | |
| 28 | + | |
| 25 | 29 | private String serviceLocation; |
| 26 | 30 | |
| 27 | 31 | private WebClient webClient; |
| ... | ... | @@ -34,6 +38,11 @@ public class YoutrackAPI { |
| 34 | 38 | this.webClient = new WebClient(BrowserVersion.FIREFOX_3_6); |
| 35 | 39 | this.webClient.setJavaScriptEnabled(false); |
| 36 | 40 | this.webClient.setCssEnabled(false); |
| 41 | + try { | |
| 42 | + this.webClient.setUseInsecureSSL(true); | |
| 43 | + } catch (GeneralSecurityException e) { | |
| 44 | + e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. | |
| 45 | + } | |
| 37 | 46 | } |
| 38 | 47 | |
| 39 | 48 | public YoutrackAPI(String serviceLocation, String username, String password) throws IOException, AuthenticationException |
| ... | ... | @@ -71,11 +80,11 @@ public class YoutrackAPI { |
| 71 | 80 | } |
| 72 | 81 | } |
| 73 | 82 | |
| 74 | - public List<Issue> searchIssuesByProject(String project, String filter) throws JAXBException, IOException | |
| 83 | + public List<Issue> searchIssuesByProject(String project) throws JAXBException, IOException | |
| 75 | 84 | { |
| 76 | - String url = serviceLocation + "/rest/issue/byproject/" + project + "?filter=" + filter; | |
| 85 | + String url = serviceLocation + "/rest/issue/byproject/" + project + "?max=" + MAX_RESULTS; | |
| 77 | 86 | WebResponse webResponse = webClient.<Page>getPage(url).getWebResponse(); |
| 78 | -// System.out.println(webResponse.getContentAsString()); | |
| 87 | + | |
| 79 | 88 | List<Issues.Issue> issues = IssuesUnmarshaller.unmarshal(webResponse.getContentAsStream()).getIssue(); |
| 80 | 89 | List<Issue> result = new ArrayList<Issue>(); |
| 81 | 90 | for (Issues.Issue issue : issues) { | ... | ... |
Please
register
or
login
to post a comment