if(file.exists( ) && file.isReadOnly( )) { MessageDialog.openError( UIUtil.getDefaultShell( ), Messages.getString( "IDEFileReportProvider.ReadOnlyEncounter.Title" ), Messages.getFormattedString( "IDEFileReportProvider.ReadOnlyEncounter.Message", new Object[]{file.getFullPath( ) } ) ); return; }
	private void saveFile( final ModuleHandle moduleHandle, final IFile file,			IProgressMonitor monitor )	{		// TODO		IRunnableWithProgress op = new IRunnableWithProgress( ) {			public synchronized final void run( IProgressMonitor monitor )					throws InvocationTargetException, InterruptedException			{				try				{					IWorkspaceRunnable workspaceRunnable = new IWorkspaceRunnable( ) {						public void run( IProgressMonitor pm )								throws CoreException						{							try							{								execute( pm );							}							catch ( CoreException e )							{								throw e;							}							catch ( IOException e )							{								ExceptionHandler.handle( e );							}						}					};					ResourcesPlugin.getWorkspace( ).run( workspaceRunnable,							ResourcesPlugin.getWorkspace( ).getRoot( ),							IResource.NONE, monitor );				}				catch ( CoreException e )				{					throw new InvocationTargetException( e );				}				catch ( OperationCanceledException e )				{					throw new InterruptedException( e.getMessage( ) );				}			}			public void execute( final IProgressMonitor monitor )					throws CoreException, IOException			{				ByteArrayOutputStream out = new ByteArrayOutputStream( );				moduleHandle.serialize( out );				byte[] bytes = out.toByteArray( );				out.close( );				ByteArrayInputStream is = new ByteArrayInputStream( bytes );				IContainer container = file.getParent( );				if ( !container.exists( ) && container instanceof IFolder )				{					UIUtil.createFolder( (IFolder) container, monitor );				}				if ( file.exists( ) )				{					file.setContents( is, true, true, monitor );				}				else				{					// Save to new file.					file.create( is, true, monitor );				}			}		};		try		{			new ProgressMonitorDialog( UIUtil.getDefaultShell( ) ).run( false,					true, op );		}		catch ( Exception e )		{			ExceptionHandler.handle( e );		}		try		{			file.refreshLocal( 0, monitor );		}		catch ( CoreException e )		{			ExceptionHandler.handle( e );		}	}