Package com.atlassian.bamboo.web.utils
Interface UploadedFileManager
-
- All Known Implementing Classes:
UploadedFileManagerImpl
@ExperimentalApi public interface UploadedFileManagerManager for files uploaded through the web. Allows actions to save file in Bamboo home dir. It is responsibility of the users of this manager to remove files that are no longer needed.- Since:
- 4.4
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull UploadedFilecreateFile(@NotNull InputStream inputStream, @NotNull String fileName, @NotNull String contentType, long size)Creates a file on disk.@NotNull UploadedFilecreateFile(@NotNull org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper requestWrapper, @NotNull String fileParamName)Creates a file on disk.longgetMaximumUploadedFileSizeBytes()@NotNull FilegetUploadedFilesDirectory()
-
-
-
Method Detail
-
createFile
@NotNull @NotNull UploadedFile createFile(@NotNull @NotNull org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper requestWrapper, @NotNull @NotNull String fileParamName) throws UploadedFileManagerException
Creates a file on disk. This method ensures that file name on disk is unique.- Parameters:
requestWrapper- the wrapper containing getFile() and getFilesystemName() describing the attachmentfileParamName- name of form parameter specifying filename (in requestWrapper).- Returns:
- A
UploadedFilecontaining details about whereabouts of the created file - Throws:
UploadedFileManagerException- iff file upload fails
-
createFile
@NotNull @NotNull UploadedFile createFile(@NotNull @NotNull InputStream inputStream, @NotNull @NotNull String fileName, @NotNull @NotNull String contentType, long size) throws UploadedFileManagerException
Creates a file on disk. This method ensures that file name on disk is unique.- Parameters:
fileName- the source filenamecontentType- the content type of the passed streamsize- the size of the passed stream.- Returns:
- A
UploadedFilecontaining details about whereabouts of the created file - Throws:
UploadedFileManagerException- iff file upload fails
-
getUploadedFilesDirectory
@NotNull @NotNull File getUploadedFilesDirectory()
- Returns:
- directory in Bamboo home, where uploaded files are stored
-
getMaximumUploadedFileSizeBytes
long getMaximumUploadedFileSizeBytes()
-
-