All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.server.util.URLContentsImpl

java.lang.Object
   |
   +----sun.server.util.URLContentsImpl

public class URLContentsImpl
extends Object
implements URLContents
This represents the interface to one disk cache entry in the DiskCache object. A list of such entries form the disk cache.


Variable Index

 o CE_DATA_BEING_FETCHED
 o CE_DATA_BEING_FILLED
 o CE_EMPTY
 o CE_FWRITE_FAILED
 o CE_READY

Constructor Index

 o URLContentsImpl()
 o URLContentsImpl(DiskCacheImpl, URL, String, int)
 o URLContentsImpl(DiskCacheImpl, URL, String, int, int, String, long, long)
 o URLContentsImpl(URLConnection)
 o URLContentsImpl(URLContents)

Method Index

 o available()
Check if the contents in this URLContents is ready for reading or is in the process of being fetched.
 o cacheable()
 o cacheHit()
This indicates that the URLContents is being accessed.
 o getContentLength()
The content length of the data on the input stream.
 o getContents()
This is the input stream from which the contents of the URL to be stored or the URL being retrieved is read.
 o getContentType()
The mime type of the contents that is referred to by the URL.
 o getHeaders()
return all the HTTP headers in a hash table format.
 o getLastModifiedDate()
The last modified date on the URL.
 o getResponseCode()
 o getResponseMessage()
 o getURL()
The URL that identifies these contents.
 o lastAccessTime()
This is the time of last access on this URL.
 o numHits()
when the URL is being read from the cache, this represents the number of times the URL has been read since being stored in the cache.
 o setCacheable(boolean)
 o setContents(URLContents)
 o setDate(long)
 o setHeaders(Hashtable)
Set the header table.
 o setInputStream(InputStream)
 o setLength(int)
 o setResponseCode(int)
 o setResponseMessage(String)
 o setType(String)
 o setUrl(URL)

Variables

 o CE_EMPTY
 public static final int CE_EMPTY
 o CE_DATA_BEING_FILLED
 public static final int CE_DATA_BEING_FILLED
 o CE_DATA_BEING_FETCHED
 public static final int CE_DATA_BEING_FETCHED
 o CE_READY
 public static final int CE_READY
 o CE_FWRITE_FAILED
 public static final int CE_FWRITE_FAILED

Constructors

 o URLContentsImpl
 public URLContentsImpl(URLConnection uc) throws IOException
 o URLContentsImpl
 public URLContentsImpl(DiskCacheImpl dc,
                        URL url,
                        String file,
                        int entrySize)
 o URLContentsImpl
 public URLContentsImpl(DiskCacheImpl dc,
                        URL url,
                        String file,
                        int entrySize,
                        int len,
                        String type,
                        long lmtime,
                        long lattime)
 o URLContentsImpl
 public URLContentsImpl(URLContents uc)
 o URLContentsImpl
 public URLContentsImpl()

Methods

 o setContents
 public synchronized void setContents(URLContents uc)
 o setUrl
 public void setUrl(URL url)
 o setInputStream
 public void setInputStream(InputStream is)
 o setLength
 public void setLength(int len)
 o setType
 public void setType(String type)
 o setDate
 public void setDate(long date)
 o getURL
 public URL getURL()
The URL that identifies these contents.

 o getContentLength
 public int getContentLength()
The content length of the data on the input stream. If a -1 is returned, the length is until EOF is read on the input stream.

 o getContentType
 public String getContentType()
The mime type of the contents that is referred to by the URL.

 o getLastModifiedDate
 public long getLastModifiedDate()
The last modified date on the URL. The date is represented as the number of miliseconds since Jan 1, 1970.

 o getResponseCode
 public int getResponseCode()
 o getResponseMessage
 public String getResponseMessage()
 o setResponseCode
 public void setResponseCode(int code)
 o setResponseMessage
 public void setResponseMessage(String msg)
 o cacheable
 public boolean cacheable()
 o setCacheable
 public void setCacheable(boolean b)
 o setHeaders
 public void setHeaders(Hashtable h)
Set the header table. The key is the header name, the value is the header value.

 o getHeaders
 public Hashtable getHeaders()
return all the HTTP headers in a hash table format. The key is the header name, the value is the header value.

 o numHits
 public int numHits()
when the URL is being read from the cache, this represents the number of times the URL has been read since being stored in the cache.

 o lastAccessTime
 public long lastAccessTime()
This is the time of last access on this URL. It is represented in seconds since Jan 1, 1970.

 o cacheHit
 public void cacheHit()
This indicates that the URLContents is being accessed. When the URLContents object is cached, whenever the object is referred to from the application, this method must be called, so that the last accessed time and the number of hits can be updated.

 o getContents
 public synchronized InputStream getContents() throws IOException
This is the input stream from which the contents of the URL to be stored or the URL being retrieved is read.

Returns:
the input stream from which contents of the URL is read
 o available
 public boolean available()
Check if the contents in this URLContents is ready for reading or is in the process of being fetched.

Returns:
true iff the data is ready for reading

All Packages  Class Hierarchy  This Package  Previous  Next  Index