RangeAwareResource, ResourceFileResourcepublic class PathResource extends java.lang.Object implements RangeAwareResource
| Constructor | Description |
|---|---|
PathResource(java.nio.file.Path file,
PathResourceManager manager,
java.lang.String path) |
|
PathResource(java.nio.file.Path file,
PathResourceManager manager,
java.lang.String path,
ETag eTag) |
| Modifier and Type | Method | Description |
|---|---|---|
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() |
|
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 callback) |
Serve the resource, and call the provided callback when complete.
|
void |
serveRange(Sender sender,
HttpServerExchange exchange,
long start,
long end,
IoCallback callback) |
Serve the resource, and call the provided callback when complete.
|
public PathResource(java.nio.file.Path file,
PathResourceManager manager,
java.lang.String path,
ETag eTag)
public PathResource(java.nio.file.Path file,
PathResourceManager manager,
java.lang.String path)
public java.lang.String getPath()
public java.util.Date getLastModified()
getLastModified in interface Resourcepublic java.lang.String getLastModifiedString()
getLastModifiedString in interface Resourcepublic ETag getETag()
public java.lang.String getName()
public boolean isDirectory()
isDirectory in interface Resourcetrue if this resource represents a directorypublic java.util.List<Resource> list()
public java.lang.String getContentType(MimeMappings mimeMappings)
ResourcegetContentType in interface Resourcepublic void serve(Sender sender, HttpServerExchange exchange, IoCallback callback)
Resourcepublic void serveRange(Sender sender, HttpServerExchange exchange, long start, long end, IoCallback callback)
RangeAwareResourceserveRange in interface RangeAwareResourcesender - The sender to use.exchange - The exchangepublic java.lang.Long getContentLength()
getContentLength in interface Resourcepublic java.lang.String getCacheKey()
getCacheKey in interface Resourcepublic java.io.File getFile()
public java.nio.file.Path getFilePath()
getFilePath in interface Resourcepublic java.io.File getResourceManagerRoot()
ResourcegetResourceManagerRoot in interface Resourcepublic java.nio.file.Path getResourceManagerRootPath()
ResourcegetResourceManagerRootPath in interface Resourcepublic java.net.URL getUrl()
public boolean isRangeSupported()
RangeAwareResourceisRangeSupported in interface RangeAwareResourcetrue if this resource supports range requestsCopyright © 2018. All rights reserved.