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

22
LINES

< > BotCompany Repo | #1030469 // Eleu: Auto-Refresh Certificates [only on server]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (4287L/22K).

!7

cmodule AutoRefreshCertificates > DynSingleFunction {
  transient FileWatchService watchService;
  
  start {
    ownResource(watchService = new FileWatchService);
    File dir = javaxSecretDir();
    watchService.addRecursiveListener(dir, f -> enter {
      if (fileNameIs(f, "keystore.p12")) {
        print("Key store changed, reloading certificates: " + f);
        doIt();
      }
    });
    print("Watching " + dir + " for keystore changes");
  }
  
  void doIt {
    call(mainMainClass(), 'serverSocketFactory_botCompanyEtc_update);
    print("Done!");
  }
}

Author comment

Began life as a copy of #1028048

download  show line numbers  debug dex  old transpilations   

Travelled to 5 computer(s): bhatertpkbcr, mqqgnosmbjvj, podlckwnjdmb, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030469
Snippet name: Eleu: Auto-Refresh Certificates [only on server]
Eternal ID of this version: #1030469/3
Text MD5: 7e3430e7496710c5aae00dd7cfe2f5d7
Transpilation MD5: 60ed861a76bf78a25fedfd74b03e0e81
Author: stefan
Category: javax / eleu
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-12-23 02:24:15
Source code size: 591 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 118 / 101131
Version history: 2 change(s)
Referenced in: [show references]