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

13
LINES

< > BotCompany Repo | #1019814 // mozillaDefaultProfileDir

JavaX fragment (include)

1  
static File mozillaDefaultProfileDir() {
2  
  File base = mozillaConfigBaseDir();
3  
  new Matches m;
4  
  S path = null;
5  
  for (S s : lines(loadTextFile(newFile(base, "profiles.ini")))) {
6  
    // TODO: Does IsRelative=0 work?
7  
    if (startsWith(s, "Path=", m))
8  
      path = m.rest();
9  
    else if (eq(s, "Default=1"))
10  
      ret path == null ? null : isAbsolutePath(path) ? newFile(path) : newFile(base, path);
11  
  }
12  
  null;
13  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 10 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019814
Snippet name: mozillaDefaultProfileDir
Eternal ID of this version: #1019814/3
Text MD5: 4c184cfa5410b01d3a21ece64028d87d
Author: stefan
Category: javax / firefox
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-27 00:23:01
Source code size: 425 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 343 / 385
Version history: 2 change(s)
Referenced in: [show references]