}
public boolean validate()
{
boolean hasFixedFormatItems = getHasFixedFormatItems(epack);
SearchDictionary tsd = new SearchDictionary(DictionaryType.CSS_VALUES);
SearchDictionary cssTypes = new SearchDictionary(DictionaryType.CSS_FILES);
SearchDictionary validTypes = new SearchDictionary(DictionaryType.VALID_TEXT_MEDIA_TYPES);
EpubCSSCheckCSSHandler handler = new EpubCSSCheckCSSHandler(report, isGlobalFixed, hasFixedFormatItems);
int numCssFiles = 0;
for (int i = 0; i < epack.getManifest().itemsLength(); i++)
{
ManifestItem itemEntry = epack.getManifest().getItem(i);
if (cssTypes.isValidMediaType(itemEntry.getMediaType()))
{
++numCssFiles;
String fileToParse = getEntryFileName(itemEntry, epack);
ZipEntry entry = epack.getZip().getEntry(fileToParse);
if (entry == null)
{
report.message(MessageId.RSC_001, new MessageLocation(epack.getFileName(), -1, -1), fileToParse);
continue;
}
try
{
InputStream inputStream = getInputStream(fileToParse);
CssSource source = new CssSource(fileToParse, inputStream);
CssParser parser = new CssParser();
handler.setPath(fileToParse);
parser.parse(source, handler, handler);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
for (int i = 0; i < epack.getManifest().itemsLength(); i++)
{
ManifestItem itemEntry = epack.getManifest().getItem(i);
if (validTypes.isValidMediaType(itemEntry.getMediaType()))
{
String fileToParse = getEntryFileName(itemEntry, epack);
ZipEntry entry = epack.getZip().getEntry(fileToParse);
if (entry == null)
{