public class FileSystemResource extends AbstractResource
org.apache.wicket.markup.html.media.FileSystemResourceReferenceAbstractResource.ContentRangeType, AbstractResource.ResourceResponse, AbstractResource.WriteCallbackIResource.AttributesCONTENT_DISPOSITION_HEADER_NAME, CONTENT_RANGE_ENDBYTE, CONTENT_RANGE_STARTBYTE, INTERNAL_HEADERS| Constructor and Description |
|---|
FileSystemResource()
Creates a new file system resource
|
FileSystemResource(Path path)
Creates a new file system resource based on the given path
|
| Modifier and Type | Method and Description |
|---|---|
protected AbstractResource.ResourceResponse |
createResourceResponse(Path path)
Creates a resource response based on the given attributes
|
protected InputStream |
getInputStream()
Gets the input stream of the given path
|
protected String |
getMimeType()
Gets the mime type to be used for the response it first uses the URL connection to get the
mime type and after this the FileTypeDetector SPI is used.
|
protected long |
getSize()
Gets the size of the resource
|
protected AbstractResource.ResourceResponse |
newResourceResponse(IResource.Attributes attributes)
Creates a new resource response and reads the given path
|
void |
respond(IResource.Attributes attributes)
Renders this resource to response using the provided attributes.
|
configureCache, getCachingStrategy, setRequestMetaData, setRequestRangeMetaData, setResponseContentRangeHeaderFields, setResponseHeaderspublic FileSystemResource(Path path)
path - the path to be read for the resourcepublic FileSystemResource()
protected AbstractResource.ResourceResponse newResourceResponse(IResource.Attributes attributes)
newResourceResponse in class AbstractResourceattributes - request attributespublic void respond(IResource.Attributes attributes)
IResourcerespond in interface IResourcerespond in class AbstractResourceIResource.respond(org.apache.wicket.request.resource.IResource.Attributes)protected AbstractResource.ResourceResponse createResourceResponse(Path path)
path - the path to create the resource response withprotected long getSize()
throws IOException
IOException - if the size attribute can't be readprotected String getMimeType() throws IOException
IOException - if the mime type could'nt be resoulvedprotected InputStream getInputStream() throws IOException
IOException - if there is an exception while receiving the input streamCopyright © 2006–2021 Apache Software Foundation. All rights reserved.