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

10
LINES

< > BotCompany Repo | #1010571 // persistentSecretText

JavaX fragment (include)

1  
static IVar<S> persistentSecretText(fS persistenceName) {
2  
  ret new IVar<S>() {
3  
    File f = secretProgramFile(urlencode(persistenceName));
4  
    
5  
    public synchronized void set(S a) { saveTextFile(f, a); }
6  
    public synchronized S get() { ret loadTextFile(f); }
7  
    public synchronized bool has() { ret fileExists(f); }
8  
    public synchronized void clear() { set(null); }
9  
  };
10  
}

Author comment

Began life as a copy of #1009538

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: #1010571
Snippet name: persistentSecretText
Eternal ID of this version: #1010571/3
Text MD5: 5a1c01b7e0f8cd96deb77cd1f455360b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-09-21 18:32:49
Source code size: 389 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 418 / 490
Version history: 2 change(s)
Referenced in: [show references]