直接说源码:
Map picMap = picList.get(0);
String img = picMap.get("capture_img")==null?"":picMap.get("capture_img").toString();
String comment = picMap.get("comment")==null?"":picMap.get("comment").toString();
sheet.getRow(4).getCell(1).setCellValue(comment);
if (img != "") {
String imgUrl = Thread.currentThread().getContextClassLoader().getResource("static"+img).getPath();
//如果图片存在
if (new File(imgUrl).exists()) {
BufferedImage bufferedImage = ImageIO.read(new File(imgUrl));
ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream();
int len = imgUrl.length();