This commit is contained in:
Dmitry Isaenko 2020-11-06 22:26:35 +03:00
parent fbd5ec970b
commit 5e5a774e34

View file

@ -24,9 +24,12 @@ import java.nio.file.Paths;
public class FilesHelper { public class FilesHelper {
public static String getRealFolder(String location){ public static String getRealFolder(String location){
try{
Path locationAsPath = Paths.get(location); Path locationAsPath = Paths.get(location);
if (Files.notExists(locationAsPath) || Files.isRegularFile(locationAsPath)) if (Files.notExists(locationAsPath) || Files.isRegularFile(locationAsPath))
return System.getProperty("user.home"); return System.getProperty("user.home");
}
catch (Exception ignored){}
return location; return location;
} }
} }