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

13
LINES

< > BotCompany Repo | #1001108 // readTextFile (function)

JavaX fragment (include)

1  
  public static String readTextFile(String fileName, String defaultContents) throws IOException {
2  
    return loadTextFile(fileName, defaultContents);
3  
  }
4  
5  
  public static String readTextFile(File file) {
6  
    try {
7  
      return readTextFile(file, null);
8  
    } catch (IOException e) { throw new RuntimeException(e); }
9  
  }
10  
  
11  
  public static String readTextFile(File file, String defaultContents) throws IOException {
12  
    return loadTextFile(file.getPath(), defaultContents);
13  
  }

Author comment

Began life as a copy of #2000562

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1001108
Snippet name: readTextFile (function)
Eternal ID of this version: #1001108/1
Text MD5: 11021613a2fd3ad02bbcba1ca3c59f3e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-09-21 18:09:38
Source code size: 490 bytes / 13 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 757 / 1083
Referenced in: [show references]