Lines 2035-2057
public class DefaultServlet extends HttpServlet {
Link Here
|
2035 |
InputStream istream = |
2035 |
InputStream istream = |
2036 |
new BufferedInputStream(resourceInputStream, input); |
2036 |
new BufferedInputStream(resourceInputStream, input); |
2037 |
|
2037 |
|
2038 |
Range currentRange = ranges.next(); |
2038 |
try { |
2039 |
|
2039 |
Range currentRange = ranges.next(); |
2040 |
// Writing MIME header. |
2040 |
|
2041 |
ostream.println(); |
2041 |
// Writing MIME header. |
2042 |
ostream.println("--" + mimeSeparation); |
2042 |
ostream.println(); |
2043 |
if (contentType != null) |
2043 |
ostream.println("--" + mimeSeparation); |
2044 |
ostream.println("Content-Type: " + contentType); |
2044 |
if (contentType != null) |
2045 |
ostream.println("Content-Range: bytes " + currentRange.start |
2045 |
ostream.println("Content-Type: " + contentType); |
2046 |
+ "-" + currentRange.end + "/" |
2046 |
ostream.println("Content-Range: bytes " + currentRange.start |
2047 |
+ currentRange.length); |
2047 |
+ "-" + currentRange.end + "/" |
2048 |
ostream.println(); |
2048 |
+ currentRange.length); |
2049 |
|
2049 |
ostream.println(); |
2050 |
// Printing content |
2050 |
|
2051 |
exception = copyRange(istream, ostream, currentRange.start, |
2051 |
// Printing content |
2052 |
currentRange.end); |
2052 |
exception = copyRange(istream, ostream, currentRange.start, |
2053 |
|
2053 |
currentRange.end); |
2054 |
istream.close(); |
2054 |
} finally { |
|
|
2055 |
istream.close(); |
2056 |
} |
2055 |
|
2057 |
|
2056 |
} |
2058 |
} |
2057 |
|
2059 |
|
2058 |
- |
|
|