Commit 018e24cf authored by 赵啸非's avatar 赵啸非

添加文件压缩

parent e5513db3
......@@ -321,10 +321,17 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
if (!file.exists()) {
continue;
}
try {
zip.putNextEntry(new ZipEntry(filePath));
IOUtils.write(FileUtil.readBytes(file), zip);
} catch (Exception e) {
log.error("异常", e);
}
log.info("file:"+file.getPath());
/* log.info("file:"+file.getPath());
ZipUtil.append(zipFile.toPath(), file.toPath(), StandardCopyOption.REPLACE_EXISTING);
ZipUtil.append(zipFile.toPath(), file.toPath(), StandardCopyOption.REPLACE_EXISTING);*/
/*
try {
zip.putNextEntry(new ZipEntry(filePath));
......@@ -342,9 +349,9 @@ public class SkinBaseServiceImpl extends AbstractCRUDServiceImpl<SkinBaseDao, Sk
FileUtil.writeToStream(downloadFile, outputStream);*/
byte[] bytes = FileUtil.readBytes(zipFile);
//byte[] bytes = FileUtil.readBytes(zipFile);
return Rest.ok(bytes);
return Rest.ok(outputStream.toByteArray());
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment