Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 243163
Collapse All | Expand All

(-)ui/org/eclipse/jdt/ui/tests/jarexport/FatJarExportTests.java (+2 lines)
Lines 10-15 Link Here
10
 *     Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 83258 [jar exporter] Deploy java application as executable jar
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 - 213638 [jar exporter] create ANT build file for current settings
11
 *     Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 213638 [jar exporter] create ANT build file for current settings
12
 *     Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 220257 [jar application] ANT build file does not create Class-Path Entry in Manifest
12
 *     Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 220257 [jar application] ANT build file does not create Class-Path Entry in Manifest
13
 *     Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 243163 [jar exporter] export directory entries in "Runnable JAR File"
13
 *******************************************************************************/
14
 *******************************************************************************/
14
package org.eclipse.jdt.ui.tests.jarexport;
15
package org.eclipse.jdt.ui.tests.jarexport;
15
16
Lines 207-212 Link Here
207
		JarPackageData data= new JarPackageData();
208
		JarPackageData data= new JarPackageData();
208
		data.setJarBuilder(new FatJarBuilder());
209
		data.setJarBuilder(new FatJarBuilder());
209
		data.setOverwrite(true);
210
		data.setOverwrite(true);
211
		data.setIncludeDirectoryEntries(true);
210
212
211
		IPath destination= ResourcesPlugin.getWorkspace().getRoot().getLocation().append(testName + ".jar");
213
		IPath destination= ResourcesPlugin.getWorkspace().getRoot().getLocation().append(testName + ".jar");
212
		data.setJarLocation(destination);
214
		data.setJarLocation(destination);
(-)ui/org/eclipse/jdt/ui/jarpackager/JarWriter3.java (-8 / +18 lines)
Lines 8-13 Link Here
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 83258 [jar exporter] Deploy java application as executable jar
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 - 243163 [jar exporter] export directory entries in "Runnable JAR File"
11
 *******************************************************************************/
12
 *******************************************************************************/
12
package org.eclipse.jdt.ui.jarpackager;
13
package org.eclipse.jdt.ui.jarpackager;
13
14
Lines 117-135 Link Here
117
			throw JarPackagerUtil.createCoreException(exception.getLocalizedMessage(), exception);
118
			throw JarPackagerUtil.createCoreException(exception.getLocalizedMessage(), exception);
118
		}
119
		}
119
	}
120
	}
120
	
121
121
	/**
122
	/**
122
	 * Creates the directory entries for the given path and writes it to the
123
	 * Creates the directory entries for the given path and writes it to the current archive. Calls
123
	 * current archive.
124
	 * addDirectories(String).
124
	 * 
125
	 * 
125
	 * @param destinationPath
126
	 * @param destinationPath the path to add
126
	 *            the path to add
127
	 * 
127
	 * 
128
	 * @throws IOException
128
	 * @throws IOException if an I/O error has occurred
129
	 *             if an I/O error has occurred
130
	 */
129
	 */
131
	protected void addDirectories(IPath destinationPath) throws IOException {
130
	protected void addDirectories(IPath destinationPath) throws IOException {
132
		String path= destinationPath.toString().replace(File.separatorChar, '/');
131
		addDirectories(destinationPath.toString());
132
	}
133
134
	/**
135
	 * Creates the directory entries for the given path and writes it to the current archive.
136
	 * 
137
	 * @param destPath the path to add
138
	 * 
139
	 * @throws IOException if an I/O error has occurred
140
	 */
141
	protected void addDirectories(String destPath) throws IOException {
142
		String path= destPath.replace(File.separatorChar, '/');
133
		int lastSlash= path.lastIndexOf('/');
143
		int lastSlash= path.lastIndexOf('/');
134
		List directories= new ArrayList(2);
144
		List directories= new ArrayList(2);
135
		while (lastSlash != -1) {
145
		while (lastSlash != -1) {
(-)ui/org/eclipse/jdt/internal/ui/jarpackagerfat/FatJarPackageWizard.java (+2 lines)
Lines 9-14 Link Here
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 83258 [jar exporter] Deploy java application as executable jar
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 - 213638 [jar exporter] create ANT build file for current settings
11
 *     Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 213638 [jar exporter] create ANT build file for current settings
12
 *     Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 243163 [jar exporter] export directory entries in "Runnable JAR File"
12
 *******************************************************************************/
13
 *******************************************************************************/
13
package org.eclipse.jdt.internal.ui.jarpackagerfat;
14
package org.eclipse.jdt.internal.ui.jarpackagerfat;
14
15
Lines 167-172 Link Here
167
	public void init(IWorkbench workbench, IStructuredSelection selection) {
168
	public void init(IWorkbench workbench, IStructuredSelection selection) {
168
		fSelection= getSelectedJavaProjects();
169
		fSelection= getSelectedJavaProjects();
169
		fJarPackage= new JarPackageData();
170
		fJarPackage= new JarPackageData();
171
		fJarPackage.setIncludeDirectoryEntries(true);
170
		setInitializeFromJarPackage(false);
172
		setInitializeFromJarPackage(false);
171
		setWindowTitle(FatJarPackagerMessages.JarPackageWizard_windowTitle);
173
		setWindowTitle(FatJarPackagerMessages.JarPackageWizard_windowTitle);
172
		setDefaultPageImageDescriptor(JavaPluginImages.DESC_WIZBAN_FAT_JAR_PACKAGER);
174
		setDefaultPageImageDescriptor(JavaPluginImages.DESC_WIZBAN_FAT_JAR_PACKAGER);
(-)ui/org/eclipse/jdt/internal/ui/jarpackagerfat/JarWriter4.java (-3 / +5 lines)
Lines 9-14 Link Here
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 83258 [jar exporter] Deploy java application as executable jar
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 - 220257 [jar application] ANT build file does not create Class-Path Entry in Manifest
11
 *     Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 220257 [jar application] ANT build file does not create Class-Path Entry in Manifest
12
 *     Ferenc Hechler, ferenc_hechler@users.sourceforge.net - 243163 [jar exporter] export directory entries in "Runnable JAR File"
12
 *******************************************************************************/
13
 *******************************************************************************/
13
package org.eclipse.jdt.internal.ui.jarpackagerfat;
14
package org.eclipse.jdt.internal.ui.jarpackagerfat;
14
15
Lines 19-25 Link Here
19
import java.util.zip.ZipEntry;
20
import java.util.zip.ZipEntry;
20
import java.util.zip.ZipFile;
21
import java.util.zip.ZipFile;
21
22
22
import org.eclipse.core.runtime.Assert;
23
import org.eclipse.core.runtime.CoreException;
23
import org.eclipse.core.runtime.CoreException;
24
import org.eclipse.core.runtime.IPath;
24
import org.eclipse.core.runtime.IPath;
25
import org.eclipse.core.runtime.Path;
25
import org.eclipse.core.runtime.Path;
Lines 48-53 Link Here
48
	}
48
	}
49
49
50
	public void addZipEntry(ZipEntry zipEntry, ZipFile zipFile, String path) throws IOException {
50
	public void addZipEntry(ZipEntry zipEntry, ZipFile zipFile, String path) throws IOException {
51
		if (fJarPackage.areDirectoryEntriesIncluded())
52
			addDirectories(path);
51
		JarEntry newEntry= new JarEntry(path.replace(File.separatorChar, '/'));
53
		JarEntry newEntry= new JarEntry(path.replace(File.separatorChar, '/'));
52
54
53
		if (fJarPackage.isCompressed())
55
		if (fJarPackage.isCompressed())
Lines 69-76 Link Here
69
	
71
	
70
	public void write(File file, IPath destinationPath) throws CoreException {
72
	public void write(File file, IPath destinationPath) throws CoreException {
71
		try {
73
		try {
72
			Assert.isLegal(!fJarPackage.areDirectoryEntriesIncluded());//Fat JAR writer does not include directory entries
73
			
74
			addFile(file, destinationPath);
74
			addFile(file, destinationPath);
75
		} catch (IOException ex) {
75
		} catch (IOException ex) {
76
			// Ensure full path is visible
76
			// Ensure full path is visible
Lines 86-91 Link Here
86
	}
86
	}
87
	
87
	
88
	private void addFile(File file, IPath path) throws IOException {
88
	private void addFile(File file, IPath path) throws IOException {
89
		if (fJarPackage.areDirectoryEntriesIncluded())
90
			addDirectories(path);
89
		JarEntry newEntry= new JarEntry(path.toString().replace(File.separatorChar, '/'));
91
		JarEntry newEntry= new JarEntry(path.toString().replace(File.separatorChar, '/'));
90
		
92
		
91
		if (fJarPackage.isCompressed())
93
		if (fJarPackage.isCompressed())

Return to bug 243163