String fileName = filePath.substring( filePath.lastIndexOf( File.separator ) );
String fileName = filePath.substring( filePath.lastIndexOf( File.separator ) + 1 );
	public boolean performFinish( )	{		// copy to template folder		String templateFolderPath = ReportPlugin.getDefault( )				.getTemplatePreference( );		String filePath = SessionHandleAdapter.getInstance( )				.getReportDesignHandle( )				.getFileName( );		String fileName = filePath.substring( filePath.lastIndexOf( File.separator ) );		String targetPath = templateFolderPath + fileName;		if ( ResourcesPlugin.getWorkspace( )				.getRoot( )				.getFile( new Path( targetPath ) ) != null )		{			ExceptionHandler.openErrorMessageBox( Messages.getString( "PublishTemplateAction.wizard.errorTitle" ),					Messages.getString( "PublishTemplateAction.wizard.message" ) );			return true;		}		int overwrite = 0;		try		{			if ( new File( targetPath ).exists( ) )			{				String[] buttons = new String[]{						IDialogConstants.YES_LABEL,						IDialogConstants.NO_LABEL,						IDialogConstants.CANCEL_LABEL				};				String question = Messages.getFormattedString( "SaveAsDialog.overwriteQuestion", //$NON-NLS-1$						new Object[]{							targetPath						} );				MessageDialog d = new MessageDialog( getShell( ),						Messages.getString( "SaveAsDialog.Question" ), //$NON-NLS-1$						null,						question,						MessageDialog.QUESTION,						buttons,						0 );				overwrite = d.open( );			}			if ( overwrite == 0 )			{				copyFile( filePath, templateFolderPath + fileName );			}		}		catch ( IOException e )		{			ExceptionHandler.handle( e );		}		try		{			setDesignFile( templateFolderPath + fileName );		}		catch ( DesignFileException e )		{			ExceptionHandler.handle( e );			return false;		}		catch ( SemanticException e )		{			ExceptionHandler.handle( e );			return false;		}		catch ( IOException e )		{			ExceptionHandler.handle( e );			return false;		}		return overwrite != 1;	}