Package org.eclipse.jgit.http.server
Class FileSender
java.lang.Object
org.eclipse.jgit.http.server.FileSender
Dumps a file over HTTP GET (or its information via HEAD).
Supports a single byte range requested via Range
HTTP header. This
feature supports a dumb client to resume download of a larger object file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long
private final long
private final Instant
private final File
private long
private final RandomAccessFile
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
close()
(package private) Instant
private static Enumeration<String>
getRange
(javax.servlet.http.HttpServletRequest req) (package private) String
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)
-
Field Details
-
path
-
source
-
lastModified
-
fileLen
private final long fileLen -
pos
private long pos -
end
private long end
-
-
Constructor Details
-
FileSender
FileSender(File path) throws FileNotFoundException - Throws:
FileNotFoundException
-
-
Method Details
-
close
void close() -
getLastModified
Instant getLastModified() -
getTailChecksum
- Throws:
IOException
-
serve
void serve(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp, boolean sendBody) throws IOException - Throws:
IOException
-
initRangeRequest
private boolean initRangeRequest(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse rsp) throws IOException - Throws:
IOException
-
getRange
-