We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
private static final ZipEntry ERROR_ZIP_ENTRY = new ZipEntry("<error>"); private static ZipEntry getNextZipEntry(ZipInputStream zipInputStream) throws IOException { ZipEntry result = ERROR_ZIP_ENTRY; try { result = zipInputStream.getNextEntry(); } catch(ZipException e) { LOG.error(e.getMessage()); zipInputStream.closeEntry(); } return result; } public static Resources loadResources(ZipInputStream zipInputStream, String defaultHtmlEncoding) throws IOException { Resources result = new Resources(); ZipEntry zipEntry; do { // get next valid zipEntry zipEntry = getNextZipEntry(zipInputStream); if((zipEntry == null) || (zipEntry == ERROR_ZIP_ENTRY) || zipEntry.isDirectory()) { continue; } // store resource Resource resource = ResourceUtil.createResource(zipEntry, zipInputStream); if(resource.getMediaType() == MediatypeService.XHTML) { resource.setInputEncoding(defaultHtmlEncoding); } result.add(resource); } while(zipEntry != null); return result; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: