writeFile

master
chengqf 2 years ago
parent b73d8b681c
commit 504ddf32d3

@ -1,6 +1,7 @@
package com.glxp.api.idc.utils;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@ -162,4 +163,15 @@ public class IDCUtils {
}
return result;
}
public static void writeFile(byte[] file, String filePath, String fileName) throws Exception {
File targetFile = new File(filePath);
if (!targetFile.exists()) {
targetFile.mkdirs();
}
FileOutputStream out = new FileOutputStream(filePath + fileName);
out.write(file);
out.flush();
out.close();
}
}

Loading…
Cancel
Save