final class FileSender
extends java.lang.Object
Supports a single byte range requested via Range HTTP header. This
feature supports a dumb client to resume download of a larger object file.
| Modifier and Type | Field and Description |
|---|---|
private long |
end |
private long |
fileLen |
private long |
lastModified |
private java.io.File |
path |
private long |
pos |
private java.io.RandomAccessFile |
source |
| Constructor and Description |
|---|
FileSender(java.io.File path) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
close() |
(package private) long |
getLastModified() |
private static java.util.Enumeration<java.lang.String> |
getRange(javax.servlet.http.HttpServletRequest req) |
(package private) java.lang.String |
getTailChecksum() |
private boolean |
initRangeRequest(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse rsp) |
(package private) void |
serve(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse rsp,
boolean sendBody) |
private final java.io.File path
private final java.io.RandomAccessFile source
private final long lastModified
private final long fileLen
private long pos
private long end
FileSender(java.io.File path)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionvoid close()
long getLastModified()
java.lang.String getTailChecksum()
throws java.io.IOException
java.io.IOExceptionvoid serve(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse rsp,
boolean sendBody)
throws java.io.IOException
java.io.IOExceptionprivate boolean initRangeRequest(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse rsp)
throws java.io.IOException
java.io.IOExceptionprivate static java.util.Enumeration<java.lang.String> getRange(javax.servlet.http.HttpServletRequest req)