diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/FileUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/FileUtils.groovy index 795297501..576869ecd 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/FileUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/ccb/FileUtils.groovy @@ -104,6 +104,43 @@ class FileUtils { sb.setLength(0) } out.close(); + return sb.toString().getBytes(charset) + } + + static def createEncryptFile(fileName, outputStr, isAppend){ + OutputStream out = new FileOutputStream(fileName, isAppend); + out.write(outputStr.getBytes("utf-8")); + out.close(); + } + + + static def createFileStringByCustomSuffix(ret, fileName, charset, suffix, lineSuffix){ + File file = new File(fileName); +// if (file.exists()) { +// file.delete(); +// } + + if (!file.getParentFile().exists()) { + boolean result = file.getParentFile().mkdirs(); + if (!result) { + System.out.println("´´½¨Ä¿Â¼Ê§°Ü"); + } + } + def sb = new StringBuffer(); + def index = 0 + for(def row : ret){ + if(row){ + index++ + sb.append(StringUtils.join(row.toArray(), suffix)) + if(index