Skip to content
Browse files

allow access to Jersey resource

  • Loading branch information...
1 parent 0a190aa commit 34d7d5f51cbeaa7f4022705767dc746351da969e @ghosthack committed Feb 17, 2012
View
21 src/main/java/com/ghosthack/jira/json/client/JiraJsonRestApiClient.java
@@ -30,10 +30,10 @@
*/
public class JiraJsonRestApiClient {
- private static final String REST_API_LATEST = "/rest/api/latest";
- private static final String PROJECT_RESOURCE = "project";
- private static final String ISSUE_RESOURCE = "issue";
- private WebResource br;
+ protected static final String REST_API_LATEST = "/rest/api/latest";
+ protected static final String PROJECT_RESOURCE = "project";
+ protected static final String ISSUE_RESOURCE = "issue";
+ protected WebResource br;
public List<String> getWatchers(String issueKey)
throws JiraJsonClientException {
@@ -145,23 +145,26 @@ protected ClientResponse basePost(String resource, Object requestEntity) {
protected WebResource wr;
- private void checkStatus(ClientResponse response, int checkStatus)
+ protected void checkStatus(ClientResponse response, int checkStatus)
throws JiraJsonClientException {
int status = response.getStatus();
if (status != checkStatus)
throw JiraJsonClientException.createResponseStatusException(status);
}
- private List<Project> readProject(InputStreamReader isr)
+ protected List<Project> readProject(InputStreamReader isr)
throws IOException, JsonParseException, JsonMappingException {
return mapper.readValue(isr, new TypeReference<List<Project>>() {
});
}
- // Always assume UTF8
- private static final Charset utf8Charset = Charset.forName("UTF-8");
+ public WebResource getWebResource() {
+ return wr;
+ }
+
+ protected static final Charset utf8Charset = Charset.forName("UTF-8");
// Reusable Jackson Mapper
- private static final ObjectMapper mapper = new ObjectMapper();
+ protected static final ObjectMapper mapper = new ObjectMapper();
}
View
9 src/main/java/com/ghosthack/jira/json/client/JiraJsonRpcApiClient.java
@@ -25,8 +25,8 @@
*/
public class JiraJsonRpcApiClient {
- private static final String GET_ISSUE = "getIssue";
- private static final String CREATE_ISSUE = "createIssue";
+ protected static final String GET_ISSUE = "getIssue";
+ protected static final String CREATE_ISSUE = "createIssue";
protected static final String ERROR = "error";
protected static final String RPC_JSON_RPC_JIRASOAPSERVICE_V2 = "/rpc/json-rpc/jirasoapservice-v2";
protected static final String JSON_RPC_2_0 = "2.0";
@@ -155,9 +155,12 @@ public JiraJsonRpcApiClient(String base, ClientConfig config) {
this(Client.create(config), base);
}
+ public WebResource getWebResource() {
+ return wr;
+ }
+
protected WebResource wr;
- // Reusable Jackson Mapper
protected final ObjectMapper mapper = new ObjectMapper();
// Always assume UTF8

0 comments on commit 34d7d5f

Please sign in to comment.
Something went wrong with that request. Please try again.