master
Dmitry Isaenko 2020-11-06 22:26:35 +03:00
parent fbd5ec970b
commit 5e5a774e34
1 changed files with 6 additions and 3 deletions

View File

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