Sonar does not like this nested if, fix that.
Change-Id: I8550d8ce4a07f5c10e918af64baffe8e2171c4c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
@PostConstruct
public void activate() throws IOException {
final File file = new File(PATH.toString());
- if (!file.exists()) {
- if (!file.mkdirs()) {
- LOG.warn("Failed to create config directory {}", PATH);
- return;
- }
+ if (!file.exists() && !file.mkdirs()) {
+ LOG.warn("Failed to create config directory {}", PATH);
+ return;
}
PATH.register(getWatchService(), OVERFLOW, ENTRY_CREATE);