public class

TempFileFactoryImpl

extends Object
implements TempFileFactory
java.lang.Object
   ↳ com.atlassian.jira.io.TempFileFactoryImpl

Class Overview

TempFileFactory implementation for managing deletion of temporary files.

Summary

Public Constructors
TempFileFactoryImpl(HttpServletVariables httpServletVariables, AttachmentConfig attachmentConfig)
Public Methods
@Nullable SessionTempFile getSessionTempFile(String path)
Returns the SessionTempFile for the file at path, which must have been previously created using makeSessionTempFile(String), or null if not found.
@Nonnull SessionTempFile makeSessionTempFile(String path)
Makes a new SessionTempFile for the file at path.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.io.TempFileFactory

Public Constructors

public TempFileFactoryImpl (HttpServletVariables httpServletVariables, AttachmentConfig attachmentConfig)

Public Methods

@Nullable public SessionTempFile getSessionTempFile (String path)

Returns the SessionTempFile for the file at path, which must have been previously created using makeSessionTempFile(String), or null if not found.

Parameters
path a relative (within java.io.tmpdir) or absolute path
Returns
  • a SessionTempFile or null if there is no SessionTempFile for path

@Nonnull public SessionTempFile makeSessionTempFile (String path)

Makes a new SessionTempFile for the file at path. The lifecycle of the SessionTempFile will become bound to the HTTP session associated with the current thread, meaning that the file will be deleted when the session is destroyed.

Note that for security reasons path must point to a file in java.io.tmpdir or in JIRA's temporary attachments directory.

Parameters
path a relative (within java.io.tmpdir) or absolute path
Returns
  • a new SessionTempFile