Fixed exsiting file discovery for installer
This commit is contained in:
1 parent
e23d73726b
commit
e61879afe4
1 file changed
+11
-9
@@ -75,22 +75,24 @@ public class InstallListener implements ActionListener
|
||||
|
||||
private boolean isPartialFileNameInFolder(File path, String... parts)
|
||||
{
|
||||
if(path.exists())
|
||||
if(path.exists() && path.isDirectory())
|
||||
{
|
||||
int contains = 0;
|
||||
|
||||
for(File file : path.listFiles())
|
||||
{
|
||||
int matches = 0;
|
||||
|
||||
for(String part : parts)
|
||||
{
|
||||
if(this.containsIgnoreCase(file.getName(), part))
|
||||
{
|
||||
contains++;
|
||||
}
|
||||
|
||||
if(contains == parts.length)
|
||||
{
|
||||
return true;
|
||||
if(matches < parts.length)
|
||||
{
|
||||
matches++;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user