* WatchService: use absolute path in processWatchEvent
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
* update interface and use a consistent name `fullPath`
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
---------
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
This simplifies the sortpom configuration and also allows for checking and reformatting them using the spotless:check and spotless:apply Maven goals.
Signed-off-by: Wouter Born <github@maindrain.net>
* Fix file based rule templates
* Add YAML Template parser
* Refactor marketplace rule template parsing
* Prevent file system access for WatchService DELETE events
Trying to check if deleted files are hidden, are readable or are directories will result in IOExceptions on many file systems, so that no action will be taken for deletions.
Signed-off-by: Arne Seime <arne.seime@gmail.com>
* Java 21 language features
* use getFirst and getLast methods
* replace new Locale by Locale.of
* replace Paths.get by Path.of
* use ThreadLocalRandom.current().nextDouble()
* add @Serial annotations
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
A static inner class does not keep an implicit reference to its enclosing instance.
This prevents a common cause of memory leaks and uses less memory per instance of the class.
Signed-off-by: Wouter Born <github@maindrain.net>
Method references are more readable because they refer to class names and usually result in less code.
Signed-off-by: Wouter Born <github@maindrain.net>
Stream.toList was introduced in Java 16 and creates an unmodifiable List so it can be used to simplify code whenever the List is not expected to be modified.
Signed-off-by: Wouter Born <github@maindrain.net>
On Samba shares a single MODIFY event may result in different sequences of CREATE/DELETE/MODIFY events. Unfortunately this is not properly handled by the underlying library and we have to re-introduce our ugly workaround. The solution itself is a bit improved over the old one as it not only keeps the last event but determines the correct event by examining the sequence of received events.
Signed-off-by: Jan N. Klug <github@klug.nrw>
* Add more null annotations
* Fix mock name
Adds null annotations to most of the tests as well as a few other classes.
Also fixes a few other SAT findings.
Fixes ~300 SAT findings in total.
Signed-off-by: Wouter Born <github@maindrain.net>
* Migrates all tests to the JUnit 5 Jupiter API
* Updates bnd to 5.1.2
* Updates maven-surefire-plugin to 3.0.0-M5
* Updates Mockito to 3.4.6
* Updates Hamcrest to 2.2
* Removes org.openhab.core.boot POM dependencies
Signed-off-by: Wouter Born <github@maindrain.net>