This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void convertFileToBase64() { | |
| String path = this.getClass().getClassLoader().getResource("10012312135.pfx").getPath(); | |
| try { | |
| byte[] b = Files.toByteArray(new File(path)); | |
| System.out.println(Base64.encodeBase64String(b)); | |
| } catch (IOException e) { | |
| e.printStackTrace(); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void watchservice() | |
| { | |
| Thread fileWatcher = new Thread(() -> | |
| { | |
| Path path = Paths.get(rootDir+"InputFiles/"+dirName+"/request"); | |
| Path dataDir = Paths.get(path); | |
| try | |
| { | |
| WatchService watcher = dataDir.getFileSystem().newWatchService(); |