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

17
LINES

< > BotCompany Repo | #1019348 // jdk_watchService_registerRecursivePath

JavaX fragment (include)

please include function jdk_watchService_start.

svoid jdk_watchService_registerRecursivePath(File path, final VF1<File> listener) ctex {
  final Set<File> listeningTo = synchroSet();
  VF1<File> listener2 = voidfunc(File f) {
    // TODO: remove listeners on deleted directory
    bool isDir = f.isDirectory();
    if (isDir && listeningTo.add(f)) pcall-short {
      //print("Watching new subdir: " + f);
      jdk_watchService_registerPath(f, this, jdk_watchService_allEventKinds());
    }
    callF(listener, f);
  };
  jdk_watchService_registerPath(path, listener2, jdk_watchService_allEventKinds());
  for (File subDir : findAllDirs(path))
    jdk_watchService_registerPath(subDir, listener2, jdk_watchService_allEventKinds());
}

Author comment

Began life as a copy of #1019345

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1019348
Snippet name: jdk_watchService_registerRecursivePath
Eternal ID of this version: #1019348/8
Text MD5: d5ed15dc268f0cb3e8494aac2b408238
Author: stefan
Category: javax / io
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-11-03 13:22:33
Source code size: 751 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 281 / 322
Version history: 7 change(s)
Referenced in: [show references]