{
try
{
BufferedReader reader = new BufferedReader(new FileReader(file));
String[] splitName = file.getName().split("/");
TypeFile typeFile = new TypeFile(typeToCheckFor, splitName[splitName.length - 1].split("\\.")[0]);
for(;;)
{
String line = null;
try
{
line = reader.readLine();
}
catch (Exception e)
{
break;
}
if (line == null)
break;
typeFile.lines.add(line);
}
reader.close();
}
catch(FileNotFoundException e)
{
e.printStackTrace();
}
catch(IOException e)
{
e.printStackTrace();
}
}
}
}
else
{
try
{
ZipFile zip = new ZipFile(contentPack);
ZipInputStream zipStream = new ZipInputStream(new FileInputStream(contentPack));
BufferedReader reader = new BufferedReader(new InputStreamReader(zipStream));
ZipEntry zipEntry = zipStream.getNextEntry();
do
{
zipEntry = zipStream.getNextEntry();
if(zipEntry == null)
continue;
TypeFile typeFile = null;
for(EnumType type : EnumType.values())
{
if(zipEntry.getName().startsWith(type.folderName + "/") && zipEntry.getName().split(type.folderName + "/").length > 1 && zipEntry.getName().split(type.folderName + "/")[1].length() > 0)
{
String[] splitName = zipEntry.getName().split("/");
typeFile = new TypeFile(type, splitName[splitName.length - 1].split("\\.")[0]);
}
}
if(typeFile == null)
{
continue;