spider.crawl
Class Cache

java.lang.Object
  |
  +--spider.crawl.Cache

public class Cache
extends java.lang.Object

Author:
Gautam Pant Used for caching and keeping tack of cached elements

Constructor Summary
Cache()
           
 
Method Summary
 boolean addToCache(java.lang.String url, java.lang.String filename, java.lang.String content, long lastModified)
          To add the content of a url to cache
 void clearCache()
          deletes all the files in the current cache assumes a maximum of two level deep directory structure
 java.lang.String getPath(java.lang.String fileName)
          Returns the path.
 void setPath(java.lang.String path)
          Sets the path.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cache

public Cache()
Method Detail

addToCache

public boolean addToCache(java.lang.String url,
                          java.lang.String filename,
                          java.lang.String content,
                          long lastModified)
To add the content of a url to cache


clearCache

public void clearCache()
deletes all the files in the current cache assumes a maximum of two level deep directory structure


getPath

public java.lang.String getPath(java.lang.String fileName)
Returns the path.

Returns:
String

setPath

public void setPath(java.lang.String path)
Sets the path.

Parameters:
path - The path to set