diff --git a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/GenController.java b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/GenController.java index d8e7ca5..f14e274 100644 --- a/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/GenController.java +++ b/hchyun/hchyun-generator/src/main/java/com/hchyun/generator/controller/GenController.java @@ -213,55 +213,6 @@ public class GenController extends GenBaseController { // } } - /** - * 将bytes流写入到本地 - * - * @param bytes - */ - public boolean compress(byte[] bytes) { - try { - String dir = Config.getProfile() + "/hchyun.zip"; - FileOutputStream fileOutputStream = new FileOutputStream(dir); - fileOutputStream.write(bytes); - fileOutputStream.flush(); - fileOutputStream.close(); - } catch (IOException e) { - e.printStackTrace(); - return false; - } - return true; - } - - /** - * 压缩到文件 - * - * @param sourceFileNames 源文件列表 - * @param zipFileName 目标压缩文件 - */ - public static void compress(List sourceFileNames, String zipFileName) { - byte[] buf = new byte[1024]; - File zipFile = new File(zipFileName); - try { - ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile)); - for (int i = 0; i < sourceFileNames.size(); i++) { - File sourceFile = new File(sourceFileNames.get(i)); - FileInputStream fis = new FileInputStream(sourceFile); - zos.putNextEntry(new ZipEntry(sourceFile.getName())); -// logge.info("压缩当前文件:{}",sourceFile.getName()); - int len; - while ((len = fis.read(buf)) > 0) { - zos.write(buf, 0, len); - } - zos.closeEntry(); - fis.close(); - } - zos.close(); - System.out.println("压缩完成"); - } catch (Exception e) { - System.out.println(e.getMessage()); - } - } - /** * 生成zip文件 */