Java Doc for Link.java in  » Web-Crawler » WebSPHINX » websphinx » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Crawler » WebSPHINX » websphinx 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   websphinx.Region
      websphinx.Element
         websphinx.Link

All known Subclasses:   websphinx.FormButton,  websphinx.Form,
Link
public class Link extends Element implements Prioritized(Code)
Link to a Web page.
author:
   Rob Miller
See Also:   Page


Field Summary
final public static  intGET
     Use the HTTP GET method to download this link.
final public static  intPOST
     Use the HTTP POST method to access this link.
protected  URLurl
    

Constructor Summary
public  Link(Tag startTag, Tag endTag, URL base)
     Make a Link from a start tag and end tag and a base URL (for relative references).
public  Link(URL url)
     Make a Link from a URL.
public  Link(File file)
     Make a Link from a File.
public  Link(String href)
     Make a Link from a string URL.

Method Summary
public static  URLFileToURL(File file)
     Convert a local filename to a URL.
public static  FileURLToFile(URL url)
     Convert a file: URL to a filename appropriate to the current system platform.
public  voiddiscardContent()
     Eliminate all references to page content.
public  voiddisconnect()
     Disconnect this link from its downloaded page (throwing away the page).
public  intgetDepth()
     Get depth of link in crawl.
public  StringgetDirectory()
     Get the directory part of the link, like "/home/dir/".
public  URLgetDirectoryURL()
     Get the URL of a page's directory.
public static  URLgetDirectoryURL(URL url)
     Get the URL of a page's directory.
public  DownloadParametersgetDownloadParameters()
     Get the download parameters used for this link.
public  StringgetFile()
     Get the filename part of the link, which includes the pathname and query but not the anchor reference.
public  StringgetFilename()
     Get the filename part of the link, like "index.html".
public  StringgetHost()
     Get the hostname of the link, like "www.cs.cmu.edu".
public  intgetMethod()
     Get the method used to access this link.
public  PagegetPage()
     Get the downloaded page to which the link points.
public  URLgetPageURL()
     Get the URL of a page, omitting any anchor reference (like #ref).
public static  URLgetPageURL(URL url)
     Get the URL of a page, omitting any anchor reference (like #ref).
public  URLgetParentURL()
     Get the URL of a page's parent directory.
public static  URLgetParentURL(URL url)
     Get the URL of a page's parent directory.
public  intgetPort()
     Get the port number of the link.
public  floatgetPriority()
     Get the priority of the link in the crawl.
public  StringgetProtocol()
     Get the network protocol of the link, like "ftp" or "http".
public  StringgetQuery()
     Get the query part of the link.
public  StringgetRef()
     Get the anchor reference of the link, like "#ref".
public  URLgetServiceURL()
     Get the URL of a Web service, omitting any query or anchor reference.
public static  URLgetServiceURL(URL url)
     Get the URL of a Web service, omitting any query or anchor reference.
public  intgetStatus()
     Get the status of the link.
public  URLgetURL()
     Get the URL.
public static  StringrelativeTo(URL here, URL there)
    
public static  StringrelativeTo(URL here, String there)
    
public  TagreplaceHref(String newHref)
     Copy the link's start tag, replacing the URL.
public  voidsetDownloadParameters(DownloadParameters dp)
     Set the download parameters used for this link.
public  voidsetPage(Page page)
     Set the page corresponding to this link.
public  voidsetPriority(float priority)
     Set the priority of the link in the crawl.
public  voidsetStatus(int event)
     Set the status of the link.
public  voidsetText(String text)
     Set the tagless-text representation of this region.
public  StringtoDescription()
     Generate a human-readable description of the link.
public  StringtoText()
     Convert the region to tagless text.
public  StringtoURL()
    
public static  StringtoURLDelimiters(String path)
    
protected  URLurlFromHref(Tag tag, URL base)
     Construct the URL for a link element, from its start tag and a base URL (for relative references).

Field Detail
GET
final public static int GET(Code)
Use the HTTP GET method to download this link.



POST
final public static int POST(Code)
Use the HTTP POST method to access this link.



url
protected URL url(Code)




Constructor Detail
Link
public Link(Tag startTag, Tag endTag, URL base) throws MalformedURLException(Code)
Make a Link from a start tag and end tag and a base URL (for relative references). The tags must be on the same page.
Parameters:
  startTag - Start tag of element
Parameters:
  endTag - End tag of element
Parameters:
  base - Base URL used for relative references



Link
public Link(URL url)(Code)
Make a Link from a URL.



Link
public Link(File file) throws MalformedURLException(Code)
Make a Link from a File.



Link
public Link(String href) throws MalformedURLException(Code)
Make a Link from a string URL.
exception:
  java.net.MalformedURLException - if the URL is invalid




Method Detail
FileToURL
public static URL FileToURL(File file) throws MalformedURLException(Code)
Convert a local filename to a URL. For example, if the filename is "C:\FOO\BAR\BAZ", the resulting URL is "file:/C:/FOO/BAR/BAZ".
Parameters:
  file - File to convert URL corresponding to file



URLToFile
public static File URLToFile(URL url) throws MalformedURLException(Code)
Convert a file: URL to a filename appropriate to the current system platform. For example, on MS Windows, if the URL is "file:/FOO/BAR/BAZ", the resulting filename is "\FOO\BAR\BAZ".
Parameters:
  url - URL to convert File corresponding to url
exception:
  MalformedURLException - if url is not afile: URL.



discardContent
public void discardContent()(Code)
Eliminate all references to page content.



disconnect
public void disconnect()(Code)
Disconnect this link from its downloaded page (throwing away the page).



getDepth
public int getDepth()(Code)
Get depth of link in crawl. depth of link from root (depth of roots is 0)



getDirectory
public String getDirectory()(Code)
Get the directory part of the link, like "/home/dir/". Always starts and ends with '/'. the directory portion of the link's URL



getDirectoryURL
public URL getDirectoryURL()(Code)
Get the URL of a page's directory. the URL sans filename, query and anchor reference



getDirectoryURL
public static URL getDirectoryURL(URL url)(Code)
Get the URL of a page's directory. the URL sans filename, query and anchor reference



getDownloadParameters
public DownloadParameters getDownloadParameters()(Code)
Get the download parameters used for this link. Default is null.



getFile
public String getFile()(Code)
Get the filename part of the link, which includes the pathname and query but not the anchor reference. Equivalent to getURL().getFile(). the filename portion of the link's URL



getFilename
public String getFilename()(Code)
Get the filename part of the link, like "index.html". Never contains '/'; may be the empty string. the filename portion of the link's URL



getHost
public String getHost()(Code)
Get the hostname of the link, like "www.cs.cmu.edu". the hostname portion of the link's URL



getMethod
public int getMethod()(Code)
Get the method used to access this link. GET or POST.



getPage
public Page getPage()(Code)
Get the downloaded page to which the link points. the Page object, or null if the page hasn't been downloaded.



getPageURL
public URL getPageURL()(Code)
Get the URL of a page, omitting any anchor reference (like #ref). the URL sans anchor reference



getPageURL
public static URL getPageURL(URL url)(Code)
Get the URL of a page, omitting any anchor reference (like #ref). the URL sans anchor reference



getParentURL
public URL getParentURL()(Code)
Get the URL of a page's parent directory. the URL sans filename, query and anchor reference



getParentURL
public static URL getParentURL(URL url)(Code)
Get the URL of a page's parent directory. the URL sans filename, query and anchor reference



getPort
public int getPort()(Code)
Get the port number of the link. the port number of the link's URL, or -1 if no port numberis explicitly specified in the URL



getPriority
public float getPriority()(Code)
Get the priority of the link in the crawl.



getProtocol
public String getProtocol()(Code)
Get the network protocol of the link, like "ftp" or "http". the protocol portion of the link's URL



getQuery
public String getQuery()(Code)
Get the query part of the link. Either starts with a '?', or is empty. the query portion of the link's URL



getRef
public String getRef()(Code)
Get the anchor reference of the link, like "#ref". Either starts with '#', or is empty. the anchor reference portion of the link's URL



getServiceURL
public URL getServiceURL()(Code)
Get the URL of a Web service, omitting any query or anchor reference. the URL sans query and anchor reference



getServiceURL
public static URL getServiceURL(URL url)(Code)
Get the URL of a Web service, omitting any query or anchor reference. the URL sans query and anchor reference



getStatus
public int getStatus()(Code)
Get the status of the link. Possible values are defined in LinkEvent. last event that happened to this link



getURL
public URL getURL()(Code)
Get the URL. the URL of the link



relativeTo
public static String relativeTo(URL here, URL there)(Code)



relativeTo
public static String relativeTo(URL here, String there)(Code)



replaceHref
public Tag replaceHref(String newHref)(Code)
Copy the link's start tag, replacing the URL. Note that the name of the attribute containing the URL varies from tag to tag: sometimes it is called HREF, sometimes SRC, sometimes CODE, etc. This method changes the appropriate attribute for this tag.
Parameters:
  newHref - New URL or relative reference; e.g. "http://www.cs.cmu.edu/" or "/foo/index.html". copy of this link's start tag with its URL attribute replaced. The copy is a region of a fresh page containing only the tag.



setDownloadParameters
public void setDownloadParameters(DownloadParameters dp)(Code)
Set the download parameters used for this link.



setPage
public void setPage(Page page)(Code)
Set the page corresponding to this link.
Parameters:
  page - Page to which this link points



setPriority
public void setPriority(float priority)(Code)
Set the priority of the link in the crawl.



setStatus
public void setStatus(int event)(Code)
Set the status of the link. Possible values are defined in LinkEvent.
Parameters:
  event - the event that just happened to this link



setText
public void setText(String text)(Code)
Set the tagless-text representation of this region.
Parameters:
  text - a string consisting of the text in the page contained by this region



toDescription
public String toDescription()(Code)
Generate a human-readable description of the link. a description of the link, in the form "[url]".



toText
public String toText()(Code)
Convert the region to tagless text. a string consisting of the text in the page contained by this region



toURL
public String toURL()(Code)
Convert the link's URL to a String the URL represented as a string



toURLDelimiters
public static String toURLDelimiters(String path)(Code)



urlFromHref
protected URL urlFromHref(Tag tag, URL base) throws MalformedURLException(Code)
Construct the URL for a link element, from its start tag and a base URL (for relative references).
Parameters:
  tag - Start tag of link, such as <A HREF="/foo/index.html">.
Parameters:
  base - Base URL used for relative references URL to which the link points



Fields inherited from websphinx.Element
protected Element child(Code)(Java Doc)
protected Tag endTag(Code)(Java Doc)
protected Element parent(Code)(Java Doc)
protected Element sibling(Code)(Java Doc)
protected Tag startTag(Code)(Java Doc)

Methods inherited from websphinx.Element
public Enumeration enumerateHTMLAttributes()(Code)(Java Doc)
public Element getChild()(Code)(Java Doc)
public Tag getEndTag()(Code)(Java Doc)
public String getHTMLAttribute(String name)(Code)(Java Doc)
public String getHTMLAttribute(String name, String defaultValue)(Code)(Java Doc)
public Element getNext()(Code)(Java Doc)
public Element getParent()(Code)(Java Doc)
public Element getSibling()(Code)(Java Doc)
public Tag getStartTag()(Code)(Java Doc)
public String getTagName()(Code)(Java Doc)
public boolean hasHTMLAttribute(String name)(Code)(Java Doc)

Fields inherited from websphinx.Region
final static int INITIAL_SIZE(Code)(Java Doc)
final public static String TRUE(Code)(Java Doc)
protected int end(Code)(Java Doc)
protected Hashtable names(Code)(Java Doc)
protected Page source(Code)(Java Doc)
protected int start(Code)(Java Doc)

Methods inherited from websphinx.Region
public Enumeration enumerateObjectLabels()(Code)(Java Doc)
public static int findEnd(Region[] regions, int p)(Code)(Java Doc)
public static int findStart(Region[] regions, int p)(Code)(Java Doc)
public int getEnd()(Code)(Java Doc)
public Region getField(String name)(Code)(Java Doc)
public Region[] getFields(String name)(Code)(Java Doc)
public String getLabel(String name)(Code)(Java Doc)
public String getLabel(String name, String defaultValue)(Code)(Java Doc)
public int getLength()(Code)(Java Doc)
public Number getNumericLabel(String name, Number defaultValue)(Code)(Java Doc)
public Object getObjectLabel(String name)(Code)(Java Doc)
public String getObjectLabels()(Code)(Java Doc)
public Element getRootElement()(Code)(Java Doc)
public Page getSource()(Code)(Java Doc)
public int getStart()(Code)(Java Doc)
public boolean hasAllLabels(String expr)(Code)(Java Doc)
public boolean hasAllLabels(String[] labels)(Code)(Java Doc)
public boolean hasAnyLabels(String expr)(Code)(Java Doc)
public boolean hasAnyLabels(String[] labels)(Code)(Java Doc)
public boolean hasLabel(String name)(Code)(Java Doc)
public void removeLabel(String name)(Code)(Java Doc)
public void setField(String name, Region region)(Code)(Java Doc)
public void setFields(String name, Region[] regions)(Code)(Java Doc)
public void setLabel(String name, String value)(Code)(Java Doc)
public void setLabel(String name)(Code)(Java Doc)
public void setObjectLabel(String name, Object value)(Code)(Java Doc)
public Region span(Region r)(Code)(Java Doc)
public String toHTML()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public String toTags()(Code)(Java Doc)
public String toText()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.