public List<Project> getProjects() throws AuthenticationFailedException, ServiceNotFoundException, Exception {
HttpURLConnection con = getServiceConnection("api/projects");
if (con.getResponseCode() == 401) {
throw new AuthenticationFailedException();
} else if (con.getResponseCode() == 404) {
throw new ServiceNotFoundException();
}
JavaType type = CollectionType.construct(ArrayList.class, SimpleType.construct(Project.class));
InputStream in = con.getInputStream();
try {
return (List<Project>) objectMapper.readValue(in, type);
} finally {
in.close();
}
}
PPTApi.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:lodms-plugins
作者:
评论列表
文章目录