
javaSE
L_zsen
我很懒~懒得写了
展开
-
使用HTTPCLIENT时出现SOCKET CLOSED 错误
今天在使用httpclient 调用第三方接口的时候出现了socket closed错误。经过一番百度,找到了原因。原因是因为在封装HttpClientUtils时在finally块中将response关闭了。调用了response.closed方法而在调用完后又需要将response转换成string,public static CloseableHttpResponse doPostJ...原创 2020-02-23 13:46:06 · 2773 阅读 · 0 评论 -
POI读取excel工具类
package com.fy.module.seeker.test;import java.io.File;import java.io.FileInputStream;import java.io.InputStream;import org.apache.poi.hssf.usermodel.HSSFCell;import org.apache.poi.hssf.usermode...原创 2020-02-22 21:56:18 · 210 阅读 · 0 评论 -
List<string> 转 string 方法 Java8自带的String.join
List a = new ArrayList<>();a.add("aa");a.add("bb");String astr = String.join(",",a);sout(astr);拼接'' astr ="'"+String.join("','",a)+"'";结果:aa,bb字符串转listList<String> listString = Arr...原创 2020-02-22 21:53:34 · 3429 阅读 · 0 评论 -
java 文件导出下载
记录下excel文件导出到客户端下载的方法,其他文件也是一样OutputStream out = response.getOutputStream();File file = new File(path);InputStream fis = new BufferedInputStream(new FileInputStream(file));byte[] buffer = new byte...原创 2020-02-22 21:49:08 · 431 阅读 · 0 评论