com.atlassian.bamboo.web.utils
Interface UploadedFileManager

All Known Implementing Classes:
UploadedFileManagerImpl

public interface UploadedFileManager

Manager 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
 UploadedFile createFile(java.io.InputStream inputStream, java.lang.String fileName, java.lang.String contentType, long size)
          Creates a file on disk.
 UploadedFile createFile(com.opensymphony.webwork.dispatcher.multipart.MultiPartRequestWrapper requestWrapper, java.lang.String fileParamName)
          Creates a file on disk.
 long getMaximumUploadedFileSizeBytes()
           
 java.io.File getUploadedFilesDirectory()
           
 

Method Detail

createFile

@NotNull
UploadedFile createFile(@NotNull
                                com.opensymphony.webwork.dispatcher.multipart.MultiPartRequestWrapper requestWrapper,
                                @NotNull
                                java.lang.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 attachment
fileParamName - name of form parameter specifying filename (in requestWrapper).
Returns:
A UploadedFile containing details about whereabouts of the created file
Throws:
UploadedFileManagerException - iff file upload fails

createFile

@NotNull
UploadedFile createFile(@NotNull
                                java.io.InputStream inputStream,
                                @NotNull
                                java.lang.String fileName,
                                @NotNull
                                java.lang.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 filename
contentType - the content type of the passed stream
size - the size of the passed stream.
Returns:
A UploadedFile containing details about whereabouts of the created file
Throws:
UploadedFileManagerException - iff file upload fails

getUploadedFilesDirectory

@NotNull
java.io.File getUploadedFilesDirectory()
Returns:
directory in Bamboo home, where uploaded files are stored

getMaximumUploadedFileSizeBytes

long getMaximumUploadedFileSizeBytes()


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.