1 /*******************************************************************************
2 * Copyright (c) 2007, 2011 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * IBM Corporation - initial API and implementation
10 * Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 83258 [jar exporter] Deploy java application as executable jar
11 * Ferenc Hechler <ferenc_hechler@users.sourceforge.net> - [jar application] add Jar-in-Jar ClassLoader option - https://bugs.eclipse.org/bugs/show_bug.cgi?id=219530
12 *******************************************************************************/
13 package org.eclipse.jdt.internal.ui.jarpackagerfat;
17 import org.eclipse.swt.widgets.Shell;
19 import org.eclipse.core.runtime.CoreException;
20 import org.eclipse.core.runtime.IPath;
21 import org.eclipse.core.runtime.MultiStatus;
23 import org.eclipse.core.resources.IFile;
25 import org.eclipse.jdt.ui.jarpackager.IJarBuilderExtension;
26 import org.eclipse.jdt.ui.jarpackager.JarPackageData;
28 import org.eclipse.jdt.internal.ui.jarpackager.JarBuilder;
31 * A builder which is able to handle referenced libraries.
35 public abstract class FatJarBuilder extends JarBuilder implements IJarBuilderExtension {
37 private JarPackageData fJarPackage;
38 private JarWriter4 fJarWriter;
40 protected JarWriter4 getJarWriter() {
44 public abstract boolean isRemoveSigners();
46 public abstract boolean isMergeManifests();
48 public abstract String getManifestClasspath();
54 public void open(JarPackageData jarPackage, Shell displayShell, MultiStatus status) throws CoreException {
55 super.open(jarPackage, displayShell, status);
56 fJarPackage= jarPackage;
57 fJarWriter= new JarWriter4(fJarPackage, displayShell);
63 public void writeFile(IFile resource, IPath destinationPath) throws CoreException {
64 fJarWriter.write(resource, destinationPath);
67 public void writeFile(File file, IPath destinationPath) throws CoreException {
68 fJarWriter.write(file, destinationPath);
74 public void close() throws CoreException {
75 if (fJarWriter != null) {