Skip to content

Commit

Permalink
#1960 application root directory not found on fresh install (#1961)
Browse files Browse the repository at this point in the history
Co-authored-by: Dennis Sheirer <[email protected]>
  • Loading branch information
DSheirer and Dennis Sheirer authored Aug 31, 2024
1 parent 36e198e commit d7fbbce
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/main/java/io/github/dsheirer/properties/SystemProperties.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit d7fbbce

Please sign in to comment.