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 java.time.Instant |
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) java.time.Instant |
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 java.time.Instant lastModified
private final long fileLen
private long pos
private long end
FileSender(java.io.File path) throws java.io.FileNotFoundException
java.io.FileNotFoundException
void close()
java.time.Instant getLastModified()
java.lang.String getTailChecksum() throws java.io.IOException
java.io.IOException
void serve(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp, boolean sendBody) throws java.io.IOException
java.io.IOException
private boolean initRangeRequest(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp) throws java.io.IOException
java.io.IOException
private static java.util.Enumeration<java.lang.String> getRange(javax.servlet.http.HttpServletRequest req)