public class FileDoc extends WebDoc
WebDoc.HTTPCodeDATA_BYTE, DATA_STREAM| Constructor and Description |
|---|
FileDoc(File file)
It simply creates a WebDoc-Object that serves the specified File.
|
FileDoc(File file,
boolean delete)
It simply creates a WebDoc-Object that serves the specified File.
|
FileDoc(Request req,
File baseDir) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
byteData()
If you want to return the documents data as a byte[],
you have to do that here.
|
void |
close()
This method is called after the transmission.
|
String |
dataType()
Specifies the Type of served data.
|
static WebDoc |
fileByReq(Request req,
File baseDir,
String appName) |
String |
mime()
This method has to return the MIME-Type of the Document.
|
String |
name()
This method has to return the FileName of the Document.
|
long |
size()
This method has to return the size of the Document in bytes.
|
InputStream |
streamData()
If you want to return the documents data as a Stream,
you have to do that here.
|
getHeaders, getHttpCode, setHTTPCodepublic FileDoc(File file) throws FileDocException
file - the File, that must be sentFileDocException - if the File does not exists.public FileDoc(File file, boolean delete) throws FileDocException
file - the File, that must be sentdelete - delete after dentFileDocException - if the File does not exists.public FileDoc(Request req, File baseDir) throws FileDocException
FileDocExceptionpublic static WebDoc fileByReq(Request req, File baseDir, String appName) throws FileDocException
FileDocExceptionpublic long size()
WebDocpublic String mime()
WebDocpublic String name()
WebDocpublic byte[] byteData()
WebDocpublic InputStream streamData()
WebDocstreamData in class WebDocpublic String dataType()
WebDocCopyright © 2020 Software Atelier Kamber. All rights reserved.