org.switchboard.browser
Class Browser
java.lang.Object
HttpClient
org.switchboard.browser.Browser
- All Implemented Interfaces:
- TreeModel
- Direct Known Subclasses:
- AllMusicMood, Feed, FoafFile, ShoutcastResult
public class Browser
- extends HttpClient
- implements TreeModel
Browser
public Browser()
Browser
public Browser(String strURL)
main
public static void main(String[] args)
refresh
public int refresh()
setAcceptCookies
public void setAcceptCookies(boolean bool)
getAcceptCookies
public boolean getAcceptCookies()
addCookie
public void addCookie(String domain,
String name,
String value)
addCookie
public void addCookie(Cookie cookie)
clearCookies
public void clearCookies()
open
public int open(String strURL)
addListener
public void addListener(BrowserListener listener)
query
public String[] query(String xquery)
save
public void save(URL dest)
throws IOException,
MalformedURLException
- Throws:
IOException
MalformedURLException
save
public void save(File dest)
throws IOException
- Throws:
IOException
newHTML
public void newHTML(String title,
String body)
getURL
public String getURL()
newXML
public void newXML()
getSentences
public String[] getSentences()
numImages
public int numImages()
getImages
public String[] getImages()
- Gets the URLs of all of the images on the webpage
- Returns:
- An array of Strings with the URLs of all of the images on the
page.
getLinks
public String[] getLinks()
- Gets all of the links on the page
- Returns:
- An array of Strings with the URLs of all of the links on the
page.
getTitle
public String getTitle()
- Gets the title of the webpage
- Returns:
- The text inside the title tag of the webpage
setTag
public void setTag(String xQuery,
String newContent)
addTreeModelListener
public void addTreeModelListener(TreeModelListener l)
- Specified by:
addTreeModelListener in interface TreeModel
getChild
public Object getChild(Object parent,
int index)
- Specified by:
getChild in interface TreeModel
getChildCount
public int getChildCount(Object parent)
- Specified by:
getChildCount in interface TreeModel
getIndexOfChild
public int getIndexOfChild(Object parent,
Object child)
- Specified by:
getIndexOfChild in interface TreeModel
getRoot
public Object getRoot()
- Specified by:
getRoot in interface TreeModel
isLeaf
public boolean isLeaf(Object node)
- Specified by:
isLeaf in interface TreeModel
removeTreeModelListener
public void removeTreeModelListener(TreeModelListener l)
- Specified by:
removeTreeModelListener in interface TreeModel
valueForPathChanged
public void valueForPathChanged(TreePath path,
Object newValue)
- Specified by:
valueForPathChanged in interface TreeModel