-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
springWarehouse/src/main/java/com/yen/springWarehouse/util/FileUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.yen.springWarehouse.util; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
|
||
import java.io.BufferedOutputStream; | ||
import java.io.DataOutputStream; | ||
import java.io.FileOutputStream; | ||
|
||
@Slf4j | ||
public class FileUtil { | ||
|
||
public Boolean writeFile(String intputString, String fileName){ | ||
|
||
try{ | ||
String value = intputString; //"Hello"; | ||
FileOutputStream fos = new FileOutputStream(fileName); | ||
DataOutputStream outStream = new DataOutputStream(new BufferedOutputStream(fos)); | ||
outStream.writeUTF(value); | ||
outStream.close(); | ||
return true; | ||
}catch (Exception e){ | ||
log.error("writeFile error : " + e); | ||
return false; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters