Bug 93030 [Import/Export] Tarfile Inputstream Broken
There appears to be issues with a InputSource created from a TarFile input stream. Steps to reproduce: 1. Export a project as a tar or tar.gz 2. Go File > Import > Import Existing Project, and select the archived project to be imported. Then click finish. 3. Fails The problem is the .project is not parsed correctly in the archived files. This is handled in org.eclipse.ui.internal.wizards.datatransfer.WizardProjectsImportPage with the call, if (projectArchiveFile != null) { newDescription = IDEWorkbenchPlugin.getPluginWorkspace() .loadProjectDescription( provider.getContents(projectArchiveFile)); which goes to org.eclipse.core.internal.resources.Workspace result = new ProjectDescriptionReader().read(new InputSource(stream)); Here result is returned as null when is should be a ProjectDescription, this is because the SAXParser fails to parse the InputSource created from the InputStream of the TarFile as gotten with TarLeveledStructureProvider.getContents(Object element) Zip and Tar files seem to be dealt with identically which suggests the problem lies somewhere in the handling of the Tar format itself.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/TarInputStream.java
}
		if(size.charAt(0) != '0') size.insert(0, '0');
		int fileSize;
		try {
			fileSize = Integer.decode(size.toString()).intValue();
		} catch(NumberFormatException nfe) {
			throw new TarException(DataTransferMessages.TarImport_invalid_tar_format, nfe); 
		}
		entry.setSize(fileSize);
		nextEOF = fileSize;
		if(fileSize % 512 > 0) {
			nextEntry = fileSize + (512 - (fileSize % 512));
		} else {
			nextEntry = fileSize;
		}
		filepos += (nextEntry + 512);
		return entry;
	}
	/**
	 * Moves ahead to the next file in the tar archive and returns
	 * a TarEntry object describing it.
	 * 
	 * @return the next entry in the tar file
	 * @throws TarException
	 * @throws IOException
	 */
	public TarEntry getNextEntry() throws TarException, IOException {
		TarEntry entry = getNextEntryInternal();
		if(entry != null && entry.getName().equals("././@LongLink")) {