From e39e34d91ee1714460cca32a594f2ba517941a98 Mon Sep 17 00:00:00 2001 From: Dennis Sheirer Date: Sat, 31 Aug 2024 08:22:23 -0400 Subject: [PATCH] #1960 application root directory not found on fresh install --- .../dsheirer/properties/SystemProperties.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/dsheirer/properties/SystemProperties.java b/src/main/java/io/github/dsheirer/properties/SystemProperties.java index dca7f295d..f81ed3d56 100644 --- a/src/main/java/io/github/dsheirer/properties/SystemProperties.java +++ b/src/main/java/io/github/dsheirer/properties/SystemProperties.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -125,14 +125,26 @@ public Path getApplicationRootPath() if(root.equalsIgnoreCase(DEFAULT_APP_ROOT)) { - retVal = Paths.get( - System.getProperty("user.home"), DEFAULT_APP_ROOT); + retVal = Paths.get(System.getProperty("user.home"), DEFAULT_APP_ROOT); } else { retVal = Paths.get(root); } + if(!Files.exists(retVal)) + { + try + { + mLog.info("Creating application root folder: " + retVal); + Files.createDirectory(retVal); + } + catch(IOException e) + { + mLog.error("Error creating sdrtrunk application root folder", e); + } + } + return retVal; }