本文整理了Java中org.apache.eagle.jpm.util.Utils.closeInputStream()
方法的一些代码示例,展示了Utils.closeInputStream()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.closeInputStream()
方法的具体详情如下:
包路径:org.apache.eagle.jpm.util.Utils
类名称:Utils
方法名:closeInputStream
暂无
代码示例来源:origin: apache/eagle
public static List<UserEmailEntity> getUserMail(Config config, String siteId, String userId) {
List<UserEmailEntity> result = new ArrayList<>();
String url = "http://"
+ config.getString(Constants.HOST_PATH)
+ ":"
+ config.getInt(Constants.PORT_PATH)
+ config.getString(Constants.CONTEXT_PATH)
+ Constants.ANALYZER_PATH
+ Constants.USER_META_ROOT_PATH
+ "/"
+ siteId
+ "/"
+ URLEncoder.encode(userId);
InputStream is = null;
try {
is = InputStreamUtils.getInputStream(url, null, org.apache.eagle.jpm.util.Constants.CompressionType.NONE);
LOG.info("get user meta from {}", url);
result = ((RESTResponse<List<UserEmailEntity>>) OBJ_MAPPER.readValue(is,
new TypeReference<RESTResponse<List<UserEmailEntity>>>() {
})).getData();
} catch (Exception e) {
LOG.warn("failed to get user meta from {}", url, e);
} finally {
org.apache.eagle.jpm.util.Utils.closeInputStream(is);
}
return result;
}
代码示例来源:origin: apache/eagle
public static List<JobMetaEntity> getJobMeta(Config config, String siteId, String jobDefId) {
List<JobMetaEntity> result = new ArrayList<>();
String url = "http://"
+ config.getString(Constants.HOST_PATH)
+ ":"
+ config.getInt(Constants.PORT_PATH)
+ config.getString(Constants.CONTEXT_PATH)
+ Constants.ANALYZER_PATH
+ Constants.JOB_META_ROOT_PATH
+ "/"
+ siteId
+ "/"
+ URLEncoder.encode(jobDefId);
InputStream is = null;
try {
is = InputStreamUtils.getInputStream(url, null, org.apache.eagle.jpm.util.Constants.CompressionType.NONE);
LOG.info("get job meta from {}", url);
result = ((RESTResponse<List<JobMetaEntity>>) OBJ_MAPPER.readValue(is,
new TypeReference<RESTResponse<List<JobMetaEntity>>>() {
})).getData();
} catch (Exception e) {
LOG.warn("failed to get job meta from {}", url, e);
} finally {
org.apache.eagle.jpm.util.Utils.closeInputStream(is);
}
return result;
}
代码示例来源:origin: apache/eagle
return false;
} finally {
Utils.closeInputStream(is);
代码示例来源:origin: apache/eagle
return false;
} finally {
Utils.closeInputStream(is);
代码示例来源:origin: apache/eagle
continue;
} finally {
Utils.closeInputStream(is);
代码示例来源:origin: apache/eagle
return false;
} finally {
Utils.closeInputStream(is);
代码示例来源:origin: apache/eagle
return false;
} finally {
Utils.closeInputStream(is);
内容来源于网络,如有侵权,请联系作者删除!