public class FileBuffer extends AbstractFileBuffer implements Receiver
File.createTempFile(String, String)
with a null
suffix.
For a custom file the constructor AbstractFileBuffer(FileFactory)
should be used.
Constructor and Description |
---|
FileBuffer()
Creates a file buffer with a default file factory.
|
FileBuffer(FileFactory factory)
Creates a file buffer that uses a file factory to create a custom upload
File . |
Modifier and Type | Method and Description |
---|---|
FileData |
getFileData()
Get the file data object.
|
FileDescriptor |
getFileDescriptor()
Get the output stream for file.
|
String |
getFileName()
Get the file name for this buffer.
|
InputStream |
getInputStream()
Get the input stream for file.
|
OutputStream |
receiveUpload(String fileName,
String mimeType)
Invoked when a new upload arrives.
|
createFileOutputStream, getLogger
public FileBuffer()
Files will be created using File.createTempFile(String, String)
and have that build 'upload_tmpfile_{FILENAME}_{currentTimeMillis}'
public FileBuffer(FileFactory factory)
File
.factory
- file factory for file bufferpublic OutputStream receiveUpload(String fileName, String mimeType)
Receiver
receiveUpload
in interface Receiver
fileName
- the desired filename of the upload, usually as specified by
the clientmimeType
- the MIME type of the uploaded filepublic FileData getFileData()
public String getFileName()
public FileDescriptor getFileDescriptor()
public InputStream getInputStream()
Copyright © 2024. All rights reserved.