private Reader getDescriptorReader( ZipFile zipFile, String descriptor ) throws IOException { ZipEntry entry = searchEntry( zipFile, descriptor ); if ( entry == null ) { return null; } InputStream is = zipFile.getInputStream( entry ); if ( is == null ) { throw new IOException( "The " + descriptor + " descriptor cannot be read in " + zipFile.getName() + "." ); } return ReaderFactory.newReader( is, ReaderFactory.UTF_8 ); }
private Reader getArchetypeDescriptorReader(ZipFile zipFile) throws IOException { ZipEntry entry=searchEntry(zipFile, StringUtils.replace(Constants.ARCHETYPE_DESCRIPTOR, File.separator, "/")); if (entry == null) { log.debug("Not found " + Constants.ARCHETYPE_DESCRIPTOR + " retrying with windows path"); entry=searchEntry(zipFile, StringUtils.replace(Constants.ARCHETYPE_DESCRIPTOR, "/", File.separator)); } if (entry == null) { throw new IOException("The " + Constants.ARCHETYPE_DESCRIPTOR + " descriptor cannot be found."); } InputStream is=zipFile.getInputStream(entry); if (is == null) { throw new IOException("The " + Constants.ARCHETYPE_DESCRIPTOR + " descriptor cannot be found."); } return new InputStreamReader(is); }
private Reader getOldArchetypeDescriptorReader(ZipFile zipFile) throws IOException { ZipEntry entry=searchEntry(zipFile, StringUtils.replace(Constants.OLD_ARCHETYPE_DESCRIPTOR, File.separator, "/")); if (entry == null) { log.debug("No found " + Constants.OLD_ARCHETYPE_DESCRIPTOR + " retrying with windows path"); entry=searchEntry(zipFile, StringUtils.replace(Constants.OLD_ARCHETYPE_DESCRIPTOR, "/", File.separator)); } if (entry == null) { throw new IOException("The " + Constants.OLD_ARCHETYPE_DESCRIPTOR + " descriptor cannot be found."); } InputStream is=zipFile.getInputStream(entry); if (is == null) { throw new IOException("The " + Constants.OLD_ARCHETYPE_DESCRIPTOR + " descriptor cannot be found."); } return new InputStreamReader(is); }
private Reader getOlderArchetypeDescriptorReader(ZipFile zipFile) throws IOException { ZipEntry entry=searchEntry(zipFile, StringUtils.replace(Constants.OLDER_ARCHETYPE_DESCRIPTOR, File.separator, "/")); if (entry == null) { log.debug("No found " + Constants.OLDER_ARCHETYPE_DESCRIPTOR + " retrying with windows path"); entry=searchEntry(zipFile, StringUtils.replace(Constants.OLDER_ARCHETYPE_DESCRIPTOR, "/", File.separator)); } if (entry == null) { throw new IOException("The " + Constants.OLDER_ARCHETYPE_DESCRIPTOR + " descriptor cannot be found."); } InputStream is=zipFile.getInputStream(entry); if (is == null) { throw new IOException("The " + Constants.OLDER_ARCHETYPE_DESCRIPTOR + " descriptor cannot be found."); } return new InputStreamReader(is); } }