Class FileResponse
java.lang.Object
net.jonathangiles.tools.teenyhttpd.response.FileResponse
- All Implemented Interfaces:
Response
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongprotected FileThis method is called when the file is about to be loaded from the file system.voidwriteBody(BufferedOutputStream dataOut)
-
Constructor Details
-
FileResponse
-
-
Method Details
-
getStatusCode
- Specified by:
getStatusCodein interfaceResponse
-
getHeaders
- Specified by:
getHeadersin interfaceResponse
-
getBodyLength
public long getBodyLength()- Specified by:
getBodyLengthin interfaceResponse
-
writeBody
- Specified by:
writeBodyin interfaceResponse- Throws:
IOException
-
getFile
This method is called when the file is about to be loaded from the file system. Overriding it offers the opportunity of modifying where the file is retrieved from.- Parameters:
filename- The name of the file to be loaded, relative to the webroot (or otherwise).- Returns:
- A File reference of the file being requested.
-