Skip to content

Instantly share code, notes, and snippets.

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();
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();
}
}