mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
Adding a validation step when searching for the application.properties
file
This commit is contained in:
parent
ce78b860be
commit
1a50107af7
1 changed files with 15 additions and 2 deletions
|
@ -60,8 +60,21 @@ public class ApplicationUtilities {
|
|||
try {
|
||||
ResourceFile pathFile = new ResourceFile(new File(pathEntry).getCanonicalPath());
|
||||
while (pathFile != null && pathFile.exists()) {
|
||||
if (new ResourceFile(pathFile, ApplicationProperties.PROPERTY_FILE).exists()) {
|
||||
return pathFile;
|
||||
ResourceFile applicationPropertiesFile =
|
||||
new ResourceFile(pathFile, ApplicationProperties.PROPERTY_FILE);
|
||||
if (applicationPropertiesFile.exists()) {
|
||||
try {
|
||||
ApplicationProperties applicationProperties =
|
||||
new ApplicationProperties(applicationPropertiesFile);
|
||||
if (!applicationProperties.getApplicationName().isEmpty()) {
|
||||
return pathFile;
|
||||
}
|
||||
}
|
||||
catch (IOException e2) {
|
||||
Msg.error(ApplicationUtilities.class,
|
||||
"Failed to read: " + applicationPropertiesFile, e2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
pathFile = pathFile.getParentFile();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue