|
19 | 19 | import java.util.Collections; |
20 | 20 | import java.util.List; |
21 | 21 |
|
22 | | -import de.linsin.github.rest.resource.RepositoriesResponse; |
23 | 22 | import de.linsin.github.rest.domain.Repository; |
| 23 | +import de.linsin.github.rest.resource.RepositoriesResponse; |
24 | 24 | import de.linsin.github.rest.resource.RepositoryResponse; |
25 | | -import org.springframework.http.converter.HttpMessageConverter; |
26 | | -import org.springframework.http.converter.json.MappingJacksonHttpMessageConverter; |
27 | 25 | import org.springframework.web.client.RestTemplate; |
28 | 26 |
|
29 | 27 | /** |
30 | 28 | * Provides methods to browser through a GitHub repository |
31 | 29 | * |
32 | 30 | * @author David Linsin - [email protected] |
33 | 31 | */ |
34 | | -public class RepositoryBrowser { |
| 32 | +public class RepositoryBrowser extends Browser { |
35 | 33 | public static final String BASE_URL = "http://github.com/api/v2/json/"; |
36 | 34 | public static final String REPOSITORIES_URL = BASE_URL.concat("repos/show/{username}"); |
37 | 35 | public static final String REPOSITORY_URL = REPOSITORIES_URL.concat("/{repo}"); |
@@ -68,12 +66,4 @@ public Repository browse(String argUsername, String argRepositoryname) { |
68 | 66 | RepositoryResponse resp = template.getForObject(REPOSITORY_URL, RepositoryResponse.class, argUsername, argRepositoryname); |
69 | 67 | return resp.getRepository(); |
70 | 68 | } |
71 | | - |
72 | | - // TODO move to base class |
73 | | - protected RestTemplate initTemplate() { |
74 | | - RestTemplate template = new RestTemplate(); |
75 | | - template.setMessageConverters(new HttpMessageConverter[] {new MappingJacksonHttpMessageConverter()}); |
76 | | - return template; |
77 | | - } |
78 | | - |
79 | 69 | } |
0 commit comments