|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.archive.wayback.replay.TextDocument
public class TextDocument
Class which wraps functionality for converting a Resource(InputStream + HTTP headers) into a StringBuilder, performing several common URL resolution methods against that StringBuilder, inserting arbitrary Strings into the page, and then converting the page back to a byte array.
| Field Summary | |
|---|---|
StringBuilder |
sb
the internal StringBuilder |
| Constructor Summary | |
|---|---|
TextDocument(Resource resource,
CaptureSearchResult result,
ResultURIConverter uriConverter)
|
|
| Method Summary | |
|---|---|
void |
addBase()
|
byte[] |
getBytes()
|
String |
getCharSet()
|
String |
getJSIncludeString(String jsUrl)
|
String |
includeJspString(String jspPath,
javax.servlet.http.HttpServletRequest httpRequest,
javax.servlet.http.HttpServletResponse httpResponse,
WaybackRequest wbRequest,
CaptureSearchResults results,
CaptureSearchResult result,
Resource resource)
|
void |
insertAtEndOfBody(String toInsert)
|
void |
insertAtStartOfBody(String toInsert)
|
void |
insertAtStartOfDocument(String toInsert)
|
void |
insertAtStartOfHead(String toInsert)
|
void |
readFully()
Read bytes from input stream, using best-guess for character encoding |
void |
readFully(String charSet)
|
void |
resolveAllPageUrls()
Update all URLs inside the page, so they resolve correctly to absolute URLs within the Wayback service. |
void |
resolveASXRefUrls()
|
void |
resolveCSSUrls()
|
void |
resolvePageUrls()
Update URLs inside the page, so those URLs which must be correct at page load time resolve correctly to absolute URLs. |
void |
setCharSet(String charSet)
|
void |
setResultBytes(byte[] resultBytes)
|
void |
stripHTML()
|
void |
writeToOutputStream(OutputStream os)
Write the contents of the page to the client. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public StringBuilder sb
| Constructor Detail |
|---|
public TextDocument(Resource resource,
CaptureSearchResult result,
ResultURIConverter uriConverter)
resource - result - uriConverter - | Method Detail |
|---|
public void addBase()
public void resolvePageUrls()
public void resolveAllPageUrls()
public void resolveCSSUrls()
public void resolveASXRefUrls()
public void stripHTML()
public void readFully(String charSet)
throws IOException
charSet -
IOException
public void readFully()
throws IOException
IOException
public byte[] getBytes()
throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic void setResultBytes(byte[] resultBytes)
public void writeToOutputStream(OutputStream os)
throws IOException
os -
IOExceptionpublic void insertAtStartOfDocument(String toInsert)
toInsert - public void insertAtStartOfHead(String toInsert)
toInsert - public void insertAtEndOfBody(String toInsert)
toInsert - public void insertAtStartOfBody(String toInsert)
toInsert -
public String includeJspString(String jspPath,
javax.servlet.http.HttpServletRequest httpRequest,
javax.servlet.http.HttpServletResponse httpResponse,
WaybackRequest wbRequest,
CaptureSearchResults results,
CaptureSearchResult result,
Resource resource)
throws javax.servlet.ServletException,
IOException
jspPath - httpRequest - httpResponse - wbRequest - results -
IOException
javax.servlet.ServletException
ParseExceptionpublic String getJSIncludeString(String jsUrl)
jsUrl -
public String getCharSet()
public void setCharSet(String charSet)
charSet - the charSet to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||