Bug 21605 - PluginImportOperation deletes & creates rather than overwriting
Summary: PluginImportOperation deletes & creates rather than overwriting
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Wassim Melhem CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 20036
  Show dependency tree
 
Reported: 2002-07-15 19:37 EDT by Jed Anderson CLA
Modified: 2002-10-01 14:09 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jed Anderson CLA 2002-07-15 19:37:57 EDT
Build: Eclipse R2.0

The PluginImportOperation performs a delete and then a create as it is 
importing resources.  The can confuse VCMs which watch the filesystem.

A possible fix for 
this is the following code:

	private void createJarPackagerFiles(IFolder sourceFolder, 
IFile jarFile)
		throws CoreException {
		IProject project = 
sourceFolder.getProject();
		IFolder scriptsFolder = 
project.getFolder("scripts");
		if (!scriptsFolder.exists()) 
{
			scriptsFolder.create(true, true, null);
		}
		IFile descriptorFile 
=
			scriptsFolder.getFile(sourceFolder.getName() + ".jardesc");

		String string 
=
			constructJarPackagerFileContent(
				sourceFolder,
				jarFile,
				descriptorFile.getFullPath());
				
		if 
(descriptorFile.exists()) {
			descriptorFile.setContents(
				new 
ByteArrayInputStream(string.getBytes()),
				true, 
				true, 
				null);
		} 
else {
			descriptorFile.create(
				new 
ByteArrayInputStream(string.getBytes()),
				true,
				null);
		}
	}
Comment 1 Jed Anderson CLA 2002-07-16 14:40:41 EDT
See also http://bugs.eclipse.org/bugs/show_bug.cgi?id=20036
Comment 2 Wassim Melhem CLA 2002-10-01 14:09:40 EDT
Fixed.  Thanks.