public class FileSegment extends Object
Modifier and Type | Field and Description |
---|---|
File |
file
The file to read a segment of.
|
Integer |
from
The offset of the first byte of the segment to read.
|
Integer |
to
The offset of the first byte after the segment to read.
|
Constructor and Description |
---|
FileSegment(File f,
String range)
Parse the HTTP Range header and determine what exact range of the file to
read.
|
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
toResponse(javax.ws.rs.core.MediaType type)
Convert to a response, as per RFC 2616.
|
public final File file
public Integer from
public Integer to
public FileSegment(File f, String range) throws FilesystemAccessException
f
- The file this refers torange
- The content of the Range header.FilesystemAccessException
- If we can't determine the length of the file (shouldn't
happen).Copyright © 2015–2018 The Apache Software Foundation. All rights reserved.