Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 342699

Summary: temp excel files left on disk since version 2.6.2
Product: z_Archived Reporter: Thierry Thierry <tbl0605>
Component: BIRTAssignee: Ruo Yin <ruo.yin>
Status: VERIFIED FIXED QA Contact: Xiaoying Gu <bluesoldier>
Severity: normal    
Priority: P3 CC: bluesoldier, sijuissac2010
Version: unspecified   
Target Milestone: 3.7.0 M7   
Hardware: All   
OS: All   
Whiteboard: Obsolete

Description Thierry Thierry CLA 2011-04-13 06:59:23 EDT
Build Identifier: M20100211-1343

I am using the BIRT runtime 2.6.2 to generate excel files, but after generation the birt_xls_* temporary files aren't removed. 

I think the problem was introduced between version 2.6.1 and 2.6.2 by changing code in class org.eclipse.birt.report.engine.emitter.excel.ExcelWriter from

	public void end( ) throws IOException
	{
		writer.end( );
		if ( tempFilePath != null )
		{
			File file = new File( tempFilePath );
			if ( file.exists( ) && file.isFile( ) )
			{
				file.delete( );
			}
		}
	}

to

	public void end( ) throws IOException
	{
		writer.end( );
	}


Reproducible: Always

Steps to Reproduce:
1. generate excel reports using BIRT runtime 2.6.2
2. go to the temp folder (defined by EngineConfig.setTempDir(tempFolder))
3. the temporary files (prefixed by "birt_xls_") aren't removed
Comment 1 Thierry Thierry CLA 2011-04-13 10:29:43 EDT
I forgot to mention in my bug report that I rebuilt the source code of Birt 2.6.2 after reverting to

    public void end( ) throws IOException
    {
        writer.end( );
        if ( tempFilePath != null )
        {
            File file = new File( tempFilePath );
            if ( file.exists( ) && file.isFile( ) )
            {
                file.delete( );
            }
        }
    }

After that, temporary files were correctly removed again.
Comment 2 Ruo Yin CLA 2011-04-18 02:22:58 EDT
Temporary file removed after using
Comment 3 Xiaoying Gu CLA 2011-04-18 02:30:09 EDT
Verified in daily build 3.7.0.v20110418
Comment 4 Xiaoying Gu CLA 2011-05-13 01:56:10 EDT
Update status.
Comment 5 CJ48 Mising name CLA 2011-09-19 03:23:13 EDT
Hi,
    I am new to birt. Can you please explain how can I change change temp directory location? My application generates flat text files, birt generates excel files from these flat files. I have created one environment variable MY_TEMP and gave it's value as 'D:\my_temp'. Now I want birt to use this folder to store all temporary files.

(In reply to comment #0)
> Build Identifier: M20100211-1343
> 
> I am using the BIRT runtime 2.6.2 to generate excel files, but after generation
> the birt_xls_* temporary files aren't removed. 
> 
> I think the problem was introduced between version 2.6.1 and 2.6.2 by changing
> code in class org.eclipse.birt.report.engine.emitter.excel.ExcelWriter from
> 
>     public void end( ) throws IOException
>     {
>         writer.end( );
>         if ( tempFilePath != null )
>         {
>             File file = new File( tempFilePath );
>             if ( file.exists( ) && file.isFile( ) )
>             {
>                 file.delete( );
>             }
>         }
>     }
> 
> to
> 
>     public void end( ) throws IOException
>     {
>         writer.end( );
>     }
> 
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. generate excel reports using BIRT runtime 2.6.2
> 2. go to the temp folder (defined by EngineConfig.setTempDir(tempFolder))
> 3. the temporary files (prefixed by "birt_xls_") aren't removed
Comment 6 Thierry Thierry CLA 2011-10-22 13:42:56 EDT
Hi,
you should look around on the net, you will find a lot of documentation and examples :
EngineConfig config = new EngineConfig();
config.setTempDir(MY_TEMP);

(In reply to comment #5)
> Hi,
>     I am new to birt. Can you please explain how can I change change temp
> directory location? My application generates flat text files, birt generates
> excel files from these flat files. I have created one environment variable
> MY_TEMP and gave it's value as 'D:\my_temp'. Now I want birt to use this folder
> to store all temporary files.
> 
> (In reply to comment #0)
> > Build Identifier: M20100211-1343
> > 
> > I am using the BIRT runtime 2.6.2 to generate excel files, but after generation
> > the birt_xls_* temporary files aren't removed. 
> > 
> > I think the problem was introduced between version 2.6.1 and 2.6.2 by changing
> > code in class org.eclipse.birt.report.engine.emitter.excel.ExcelWriter from
> > 
> >     public void end( ) throws IOException
> >     {
> >         writer.end( );
> >         if ( tempFilePath != null )
> >         {
> >             File file = new File( tempFilePath );
> >             if ( file.exists( ) && file.isFile( ) )
> >             {
> >                 file.delete( );
> >             }
> >         }
> >     }
> > 
> > to
> > 
> >     public void end( ) throws IOException
> >     {
> >         writer.end( );
> >     }
> > 
> > 
> > Reproducible: Always
> > 
> > Steps to Reproduce:
> > 1. generate excel reports using BIRT runtime 2.6.2
> > 2. go to the temp folder (defined by EngineConfig.setTempDir(tempFolder))
> > 3. the temporary files (prefixed by "birt_xls_") aren't removed