RangeAwareResource
, Resource
public class CachedResource extends java.lang.Object implements Resource, RangeAwareResource
Constructor | Description |
---|---|
CachedResource(CachingResourceManager cachingResourceManager,
Resource underlyingResource,
java.lang.String path) |
Modifier and Type | Method | Description |
---|---|---|
boolean |
checkStillValid() |
|
java.lang.String |
getCacheKey() |
|
java.lang.Long |
getContentLength() |
|
java.lang.String |
getContentType(MimeMappings mimeMappings) |
Return the resources content type.
|
ETag |
getETag() |
|
java.io.File |
getFile() |
|
java.nio.file.Path |
getFilePath() |
|
java.util.Date |
getLastModified() |
|
java.lang.String |
getLastModifiedString() |
|
java.lang.String |
getName() |
|
java.lang.String |
getPath() |
|
java.io.File |
getResourceManagerRoot() |
Returns the resource manager root.
|
java.nio.file.Path |
getResourceManagerRootPath() |
Returns the resource manager root.
|
java.net.URL |
getUrl() |
|
void |
invalidate() |
|
boolean |
isDirectory() |
|
boolean |
isRangeSupported() |
It is possible that some resources managers may only support range requests on a subset of their resources,
|
java.util.List<Resource> |
list() |
|
void |
serve(Sender sender,
HttpServerExchange exchange,
IoCallback completionCallback) |
Serve the resource, and call the provided callback when complete.
|
void |
serveRange(Sender sender,
HttpServerExchange exchange,
long start,
long end,
IoCallback completionCallback) |
Serve the resource, and call the provided callback when complete.
|
public CachedResource(CachingResourceManager cachingResourceManager, Resource underlyingResource, java.lang.String path)
public java.lang.String getPath()
public java.util.Date getLastModified()
getLastModified
in interface Resource
public java.lang.String getLastModifiedString()
getLastModifiedString
in interface Resource
public ETag getETag()
public java.lang.String getName()
public boolean isDirectory()
isDirectory
in interface Resource
true
if this resource represents a directorypublic java.util.List<Resource> list()
public java.lang.String getContentType(MimeMappings mimeMappings)
Resource
getContentType
in interface Resource
public void invalidate()
public boolean checkStillValid()
public void serve(Sender sender, HttpServerExchange exchange, IoCallback completionCallback)
Resource
public java.lang.Long getContentLength()
getContentLength
in interface Resource
public java.lang.String getCacheKey()
getCacheKey
in interface Resource
public java.io.File getFile()
public java.nio.file.Path getFilePath()
getFilePath
in interface Resource
public java.io.File getResourceManagerRoot()
Resource
getResourceManagerRoot
in interface Resource
public java.nio.file.Path getResourceManagerRootPath()
Resource
getResourceManagerRootPath
in interface Resource
public java.net.URL getUrl()
public void serveRange(Sender sender, HttpServerExchange exchange, long start, long end, IoCallback completionCallback)
RangeAwareResource
serveRange
in interface RangeAwareResource
sender
- The sender to use.exchange
- The exchangepublic boolean isRangeSupported()
RangeAwareResource
isRangeSupported
in interface RangeAwareResource
true
if this resource supports range requestsCopyright © 2018. All rights reserved.