Uiinfrastructure API Docs  
 

TempFile.CreateTempFile Method 

This is how we create a temp file. Step #1: Use the sub-directory name supplied to find or create a subdirectory of the BASE_TEMP_DIR. Step #2: Using the file prefix and extension, we attempt to create a new file. If there is an existing file with the same name, we will append a number after the file prefix in order to make it unique. Step #3: We walk through all of the files in the supplied subdirectory and delete any whose last modified date is older than the expiration time. NOTE*: The expiration time is a minimum only and does not "stick" with the file created. It is used against all files in the sub-directory to determine when they should be deleted. The file created by this function will be deleted based on the expiration time passed into subsequent calls to this function - not based on this expiration time. NOTE**: The expiration time is measured from the last modified time of the created temp file - not the create time. Returns the full path of the created temp file. The created temp file may have some data in it. It is expected that the caller overwrite the created tempfile with their own data.

public static string CreateTempFile(
   string strSubDirectory,
   string strFilePrefix,
   string strFileExtension,
   int nExpireFilesOlderThanMinutes
);

See Also

TempFile Class | com.plumtree.uiinfrastructure.tempfile Namespace