public class SystemFile extends Object implements FileCustomizableResponseType
File
instances to the client. More efficient
than StreamedFile
.ATTACHMENT_HEADER
Constructor and Description |
---|
SystemFile(File file) |
SystemFile(File file,
MediaType mediaType) |
Modifier and Type | Method and Description |
---|---|
SystemFile |
attach()
Sets the file to be downloaded as an attachment.
|
SystemFile |
attach(String attachmentName)
Sets the file to be downloaded as an attachment.
|
File |
getFile() |
long |
getLastModified() |
long |
getLength() |
MediaType |
getMediaType() |
String |
getName()
Deprecated.
|
void |
process(MutableHttpResponse response)
Modify the response before it is written to the client.
|
public SystemFile(File file)
file
- The file to respond withpublic long getLastModified()
getLastModified
in interface FileCustomizableResponseType
public long getLength()
getLength
in interface FileCustomizableResponseType
@Deprecated public String getName()
getName
in interface FileCustomizableResponseType
public MediaType getMediaType()
getMediaType
in interface FileCustomizableResponseType
public File getFile()
public SystemFile attach()
public SystemFile attach(String attachmentName)
attachmentName
- The name of the file to be attached.public void process(MutableHttpResponse response)
CustomizableResponseType
process
in interface CustomizableResponseType
response
- The response to modify