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

16
LINES

< > BotCompany Repo | #1030471 - serverSocketFactory_autoUpdate

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

Libraryless. Click here for Pure Java version (4664L/28K).

static AutoCloseable serverSocketFactory_autoUpdate(IF0<AutoCloseable> enter default null) { 
  temp new CloseablesHolder resources;
  new FileWatchService watchService;
  resources.add(watchService);
  
  File dir = javaxSecretDir();
  watchService.addRecursiveListener(dir, f -> {
    temp getVar(enter);
    if (fileNameIs(f, "keystore.p12")) {
      print("Key store changed, reloading certificates: " + f);
      serverSocketFactory_botCompanyEtc_update();
    }
  });
  print("Watching " + dir + " for keystore changes");
  ret resources.takeOut(watchService);
}

download  show line numbers  debug dex   

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

No comments. add comment

Snippet ID: #1030471
Snippet name: serverSocketFactory_autoUpdate
Eternal ID of this version: #1030471/3
Text MD5: dbeb3c888ce456716bbd8a192b2a1b8e
Transpilation MD5: 55bd7850b46a7575335898ba4f10cfb7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-12-23 02:38:27
Source code size: 583 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 23 / 41
Version history: 2 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1030471 & http://1030471.tinybrain.de