|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--websphinx.HTMLTransformer | +--websphinx.LinkTransformer | +--websphinx.Mirror
Offline mirror of a Web site. Web pages written to a mirror are stored as files on the local disk in a directory structure mirroring their URLs.
Field Summary |
Fields inherited from class websphinx.LinkTransformer |
base, map |
Constructor Summary | |
Mirror(java.lang.String directory)
Make a new Mirror. |
Method Summary | |
void |
close()
Close the mirror. |
java.lang.String |
getDefaultFilename()
Get the filename used for directory URLs. |
int |
getPageCount()
Get number of pages written to this mirror. |
java.lang.String |
lookupDir(java.net.URL base,
java.net.URL url)
Lookup the local directory to which a remote directory URL maps. |
static void |
main(java.lang.String[] args)
|
void |
mapDir(java.net.URL url,
java.lang.String dir)
Map a directory URL (of the form http://host/path/) to a local directory. |
void |
rewrite()
Rewrite the mirror to make local links consistent. |
void |
setDefaultFilename(java.lang.String filename)
Set the filename used for directory URLs. |
void |
write(Region region)
Writes a chunk of HTML through the HTML transformer. |
void |
write(java.lang.String string)
Writes a literal string through the HTML transformer (without parsing it or transforming it). |
void |
writePage(Page page)
Write a page to the mirror. |
Methods inherited from class websphinx.LinkTransformer |
getBase, getEmitBaseElement, handleBase, handleElement, handleLink, isMapped, lookup, map, map, setBase, setEmitBaseElement |
Methods inherited from class websphinx.HTMLTransformer |
emit, emit, finalize, flush, getFilePointer, getOutputStream, getOutputWriter, getRandomAccessFile, seek, setOutput, setRandomAccessFile, transformContents, transformElement |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Mirror(java.lang.String directory) throws java.io.IOException
directory
- Root directory (on local disk
relative to which the mirror pages are stored)Method Detail |
public java.lang.String getDefaultFilename()
public void setDefaultFilename(java.lang.String filename)
filename
- Default filename.public int getPageCount()
public void write(Region region) throws java.io.IOException
HTMLTransformer
write
in class HTMLTransformer
websphinx.HTMLTransformer
region
- Region to writepublic void write(java.lang.String string) throws java.io.IOException
HTMLTransformer
write
in class HTMLTransformer
websphinx.HTMLTransformer
string
- String to writepublic void writePage(Page page) throws java.io.IOException
writePage
in class LinkTransformer
page
- Page to writepublic void close() throws java.io.IOException
close
in class HTMLTransformer
public void rewrite() throws java.io.IOException
public void mapDir(java.net.URL url, java.lang.String dir) throws java.net.MalformedURLException
url
- Directory URL. Must end with a slash.dir
- Local directory relative to which descendents of
url should be saved.public java.lang.String lookupDir(java.net.URL base, java.net.URL url)
base
- local file URL to use as a base. If non-null,
then the returned pathname is relative to this URL. If
null, the returned pathname is an absolute URL (file:/path/).url
- remote directory URL to look up. Must end in slash.public static void main(java.lang.String[] args) throws java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |