Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1035310 // saveTextFileWithoutTemp

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (7966L/45K).

1  
static File saveTextFileWithoutTemp(File file, S contents) ctex {
2  
  mkdirsForFile(file);
3  
  temp var fileOutputStream = newFileOutputStream(file);
4  
  var outputStreamWriter = new OutputStreamWriter(fileOutputStream, "UTF-8");
5  
  var printWriter = new PrintWriter(outputStreamWriter);
6  
  printWriter.print(unnull(contents));
7  
  printWriter.close();
8  
  ret file;
9  
}

Author comment

Began life as a copy of #1001042

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035310
Snippet name: saveTextFileWithoutTemp
Eternal ID of this version: #1035310/4
Text MD5: 3369d3ef2a56ea018b07c62e2e980829
Transpilation MD5: 41de4f208d317d854ec8d17c51fb02c0
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-30 15:10:01
Source code size: 364 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 135 / 198
Version history: 3 change(s)
Referenced in: [show references]