涉台未提交代码

This commit is contained in:
2025-03-17 15:11:11 +08:00
parent d0cd6e575e
commit b335505d7f
@@ -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<ret.size()){
sb.append(lineSuffix+"\n");
}else{
sb.append(lineSuffix);
}
}
}
return sb.toString()
}