public class PagedRepresentation
extends org.restlet.resource.CharacterRepresentation
Modifier and Type | Field and Description |
---|---|
protected EnhDirectoryResource |
dirResource
wrapped EnhDirectoryResource; used to formulate self-links
|
protected File |
file
File
|
protected org.restlet.resource.FileRepresentation |
fileRepresentation
wrapped FileRepresentation
|
protected int |
lineCount
desired line count; negative to go back from position; default 128
|
protected List<String> |
lines
text lines
|
protected long |
position
position in file around which to fetch lines
|
protected org.apache.commons.lang.math.LongRange |
range
position range [start-of-first-line, past-end-of-last-line] in file
|
protected boolean |
reversedOrder
whether to display lines in reversed order (latest first)
|
Constructor and Description |
---|
PagedRepresentation(org.restlet.resource.FileRepresentation representation,
EnhDirectoryResource resource,
String pos,
String lines,
String reverse) |
Modifier and Type | Method and Description |
---|---|
protected void |
emitBumper(PrintWriter pw,
boolean atTop)
Emit a "start" or "EOF" bumper as appropriate to prominently
indicate if page borders start- or end- of-file.
|
protected void |
emitControls(PrintWriter pw)
Emit the navigational controls.
|
protected String |
getControlUri(long pos,
int lines,
boolean reverse)
Construct navigational URI for given parameters.
|
Reader |
getReader() |
protected void |
loadLines()
Actually read the requested lines, and reverses if appropriate.
|
void |
write(Writer writer)
Write the paged HTML.
|
getChannel, getStream, write, write
checkDigest, checkDigest, computeDigest, createEmpty, exhaust, getAvailableSize, getDigest, getDownloadName, getExpirationDate, getModificationDate, getRange, getSize, getTag, getText, isAvailable, isDownloadable, isTransient, release, setAvailable, setDigest, setDownloadable, setDownloadName, setExpirationDate, setModificationDate, setRange, setSize, setTag, setTransient
protected org.restlet.resource.FileRepresentation fileRepresentation
protected EnhDirectoryResource dirResource
protected long position
protected int lineCount
protected boolean reversedOrder
protected org.apache.commons.lang.math.LongRange range
protected File file
public PagedRepresentation(org.restlet.resource.FileRepresentation representation, EnhDirectoryResource resource, String pos, String lines, String reverse)
public Reader getReader() throws IOException
getReader
in class org.restlet.resource.Representation
IOException
protected void loadLines() throws IOException
IOException
public void write(Writer writer) throws IOException
write
in class org.restlet.resource.Representation
IOException
Representation.write(java.io.Writer)
protected void emitBumper(PrintWriter pw, boolean atTop)
pw
- PrintWriteratTop
- boolean, true if at top of pageprotected void emitControls(PrintWriter pw)
pw
- PrintWriterprotected String getControlUri(long pos, int lines, boolean reverse)
pos
- desired position in filelines
- desired signed line countreverse
- if line ordering should be displayed in reverseCopyright © 2003-2014 Internet Archive. All Rights Reserved.