private void addFile(String destinationPath, ZipEntry jarEntry, ZipFile zipFile) { // Handle META-INF/MANIFEST.MF if (destinationPath.equalsIgnoreCase("META-INF/MANIFEST.MF") //$NON-NLS-1$ || (isRemoveSigners() && destinationPath.startsWith("META-INF/") && destinationPath.endsWith(".SF"))) { //$NON-NLS-1$//$NON-NLS-2$ return; } try { getJarWriter().addZipEntry(jarEntry, zipFile, destinationPath); } catch (IOException ex) { if (ex instanceof ZipException && ex.getMessage() != null && ex.getMessage().startsWith("duplicate entry:")) {//$NON-NLS-1$ // ignore duplicates in META-INF (*.SF, *.RSA) if (!destinationPath.startsWith("META-INF/")) { //$NON-NLS-1$ addWarning(ex.getMessage(), ex); } } else addWarning(Messages.format(FatJarPackagerMessages.FatJarBuilder_error_readingArchiveFile, new Object[] { BasicElementLabels.getResourceName(zipFile.getName()), ex.getLocalizedMessage() }), ex); } } }
private void addFile(String destinationPath, ZipEntry jarEntry, ZipFile zipFile) { // Handle META-INF/MANIFEST.MF if (destinationPath.equalsIgnoreCase("META-INF/MANIFEST.MF") //$NON-NLS-1$ || (isRemoveSigners() && destinationPath.startsWith("META-INF/") && destinationPath.endsWith(".SF"))) { //$NON-NLS-1$//$NON-NLS-2$ return; } try { getJarWriter().addZipEntry(jarEntry, zipFile, destinationPath); } catch (IOException ex) { if (ex instanceof ZipException && ex.getMessage() != null && ex.getMessage().startsWith("duplicate entry:")) {//$NON-NLS-1$ // ignore duplicates in META-INF (*.SF, *.RSA) if (!destinationPath.startsWith("META-INF/")) { //$NON-NLS-1$ addWarning(ex.getMessage(), ex); } } else addWarning(Messages.format(FatJarPackagerMessages.FatJarBuilder_error_readingArchiveFile, new Object[] { BasicElementLabels.getResourceName(zipFile.getName()), ex.getLocalizedMessage() }), ex); } } }