generated from root/miduo_server
master
parent
9b67406c5f
commit
de572957e8
|
|
@ -1,5 +1,7 @@
|
|||
package com.jmfy.utils;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
|
@ -8,8 +10,9 @@ import java.io.*;
|
|||
import java.util.List;
|
||||
|
||||
public class TXTUtils {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(TXTUtils.class);
|
||||
public static void writeToTxt(List list, String path) throws IOException {
|
||||
LOGGER.info("writeToTxt=>path={}",path);
|
||||
FileWriter in = null;
|
||||
File file = new File(path);
|
||||
if (!file.exists()) {
|
||||
|
|
@ -19,7 +22,7 @@ public class TXTUtils {
|
|||
for (Object obj : list){
|
||||
in.write(obj + "\r\n");
|
||||
}
|
||||
in.close();;
|
||||
in.close();
|
||||
}
|
||||
|
||||
public static ResponseEntity<byte[]> buildResponseEntity(File file) throws IOException {
|
||||
|
|
|
|||
Loading…
Reference in New Issue