org.unitils.io.annotation
Annotation Type TempFile


@Target(value=FIELD)
@Retention(value=RUNTIME)
public @interface TempFile

Annotation for creating a temporary file.

A optional name can be specified for file. If no name is specified, a default name 'class-name'-'method-name'.tmp will be used.

The parent directory for this file can be specified by setting the DefaultTempServiceFactory.ROOT_TEMP_DIR property. If no root temp dir is specified the default user temp dir will be used.

Watch out: if the file already exists, it will first be deleted.

By default, the file will not be removed after the test. You can set the IOModule.CLEANUP_AFTER_TEST property to true if you want unitils to delete the files automatically after each test.

Since:
3.3
Author:
Jeroen Horemans, Tim Ducheyne, Thomas De Rycke

Optional Element Summary
 String value
           
 

value

public abstract String value
Returns:
The name for the temp file. If not specified, a default name 'class-name'-'method-name'.tmp will be used.
Default:
""


Copyright © 2011. All Rights Reserved.