PPTApi.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:lodms-plugins 作者:
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();
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号