Fix: smarter file selection for downloaded zipped game files from gb64.com
This commit is contained in:
parent
2fd367d0b3
commit
7a0ca694ea
|
@ -860,7 +860,7 @@ public class FileManager
|
|||
{
|
||||
fis = new FileInputStream(zipFilePath);
|
||||
ZipArchiveInputStream zis = new ZipArchiveInputStream(fis);
|
||||
ZipEntry ze = zis.getNextZipEntry();
|
||||
ZipEntry ze = getFirstMatchingZipEntry(zis);
|
||||
if (ze != null)
|
||||
{
|
||||
String fileName = ze.getName();
|
||||
|
@ -886,5 +886,15 @@ public class FileManager
|
|||
}
|
||||
return filePath != null ? filePath.toFile() : null;
|
||||
}
|
||||
|
||||
private static ZipEntry getFirstMatchingZipEntry(ZipArchiveInputStream zis) throws IOException
|
||||
{
|
||||
ZipEntry ze = zis.getNextZipEntry();
|
||||
if (ze != null && ze.getName().endsWith(".NFO"))
|
||||
{
|
||||
ze = zis.getNextZipEntry();
|
||||
}
|
||||
return ze;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue