org.openrdf.http.object.cache
Class CachedEntity
java.lang.Object
org.openrdf.http.object.cache.CachedEntity
public class CachedEntity
- extends Object
A cached response HTTP entity.
- Author:
- James Leigh
CachedEntity
public CachedEntity(File head,
File body)
throws IOException
- Throws:
IOException
CachedEntity
public CachedEntity(String method,
String url,
org.apache.http.HttpResponse store,
File tmp,
File head,
File body)
throws IOException
- Throws:
IOException
getURL
public static String getURL(File head)
throws IOException
- Throws:
IOException
isMissing
public boolean isMissing()
matching
public Lock matching()
throws InterruptedException
- Throws:
InterruptedException
inUse
public boolean inUse()
open
public Lock open()
throws InterruptedException
- Throws:
InterruptedException
delete
public void delete()
throws InterruptedException
- Throws:
InterruptedException
addRequest
public void addRequest(Request req)
throws IOException
- Throws:
IOException
setResponse
public void setResponse(org.apache.http.HttpResponse store,
File tmp)
throws IOException,
InterruptedException
- Throws:
IOException
InterruptedException
isVariation
public boolean isVariation(Request req)
mustRevalidate
public boolean mustRevalidate()
getAge
public int getAge(long now)
contentLength
public Long contentLength()
getContentLength
public String getContentLength()
getContentHeader
public String getContentHeader(String name)
getContentHeaders
public Map<String,String> getContentHeaders()
date
public long date()
getDate
public String getDate()
getEntityTag
public String getEntityTag()
getETag
public String getETag()
lastModified
public long lastModified()
getLastModified
public String getLastModified()
getLifeTime
public int getLifeTime()
throws IOException
- Throws:
IOException
getLifeTime
public int getLifeTime(long now)
throws IOException
- Throws:
IOException
getMethod
public String getMethod()
getStatus
public Integer getStatus()
getStatusText
public String getStatusText()
getURL
public String getURL()
getWarning
public String getWarning()
getContentType
public String getContentType()
isPublic
public boolean isPublic()
isStale
public boolean isStale()
setStale
public void setStale(boolean stale)
throws IOException
- Throws:
IOException
isBodyPresent
public boolean isBodyPresent()
getBody
public File getBody()
writeBody
public FileChannel writeBody()
throws IOException
- Throws:
IOException
writeBody
public ReadableByteChannel writeBody(long start,
long length)
throws IOException
- Throws:
IOException
toString
public String toString()
- Overrides:
toString in class Object
Copyright © 2004-2010 James Leigh Services Inc.. All Rights Reserved.