Class HTMLpage
java.lang.Object
|
+----HTMLpage
- public class HTMLpage
- extends Object
HTMLpage class store one page pointed by one single URL, it contains
a linked list of hyperlinks inside the page
As of now, only 3 type of tags: A HREF, backgroudimage, img can be
recognized
-
HTMLpage(String)
- create a HTMLpage object given a single url
-
analysis()
- find out all the link inside that page
-
download()
- start to download the content from the URL
-
getDocumentBase()
- return the directory the file is located in the ORIGINAL URL
for the use of directory reorder
-
getFilename(String)
- return a usable local file name
-
getURL()
- return the URL of this page
-
isImage(String)
- static utilily function to test if a given URL is a image or not
-
save(DB, String)
- save the content of page to a local direcotry, modify the link
structure according to the content of DB
HTMLpage
public HTMLpage(String url)
- create a HTMLpage object given a single url
isImage
public static int isImage(String url)
- static utilily function to test if a given URL is a image or not
- Parameters:
- url - the url
- Returns:
- 1 if the url is pointing to a image, otherwise return 0
download
public int download()
- start to download the content from the URL
getDocumentBase
public String getDocumentBase()
- return the directory the file is located in the ORIGINAL URL
for the use of directory reorder
getFilename
public String getFilename(String fullname)
- return a usable local file name
- Parameters:
- fullname - the original filename (including path) in the URL
- Returns:
- a local filename
getURL
public URL getURL()
- return the URL of this page
save
public boolean save(DB dbref,
String dir)
- save the content of page to a local direcotry, modify the link
structure according to the content of DB
- Parameters:
- dbref - the database object, used to decide a link is remote or local
- dir - the local directory the file will be saved to
- Returns:
- ture if the save operation is successful
analysis
public Vector analysis()
- find out all the link inside that page