public class DownloadableClasspathResource extends Object
DownloadableResource that will serve the resource from the plugin.Plugin#getResourceAsStream(String)}.| Modifier and Type | Field and Description |
|---|---|
protected String |
extraPath |
protected Plugin |
plugin |
protected ResourceLocation |
resourceLocation |
| Constructor and Description |
|---|
DownloadableClasspathResource(Plugin plugin,
ResourceLocation resourceLocation,
String extraPath) |
| Modifier and Type | Method and Description |
|---|---|
String |
getContentType()
Returns the content type for the resource.
|
protected String |
getLocation()
This is called to return the location of the resource that this object
represents.
|
protected InputStream |
getResourceAsStream(String resourceLocation)
Returns an
InputStream to stream the resource from based on
resource name. |
ResourceLocation |
getResourceLocation() |
boolean |
isResourceModified(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
Returns true if the plugin resource has been modified.
|
void |
serveResource(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Writes the resource content out into the response.
|
void |
streamResource(OutputStream out)
Write the resource to the supplied OutputStream.
|
String |
toString() |
protected final Plugin plugin
protected final String extraPath
protected final ResourceLocation resourceLocation
public DownloadableClasspathResource(Plugin plugin, ResourceLocation resourceLocation, String extraPath)
protected InputStream getResourceAsStream(String resourceLocation)
InputStream to stream the resource from based on
resource name.resourceLocation - the location of the resource to try and loadpublic ResourceLocation getResourceLocation()
public void serveResource(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws DownloadException
DownloadableResourceserveResource in interface DownloadableResourceDownloadException - if there were errors writing to the response.public void streamResource(OutputStream out) throws DownloadException
DownloadableResourcestreamResource in interface DownloadableResourceout - the stream to write toDownloadException - if there were errors writing to the response. Since 2.3.public boolean isResourceModified(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse)
DownloadableResourceisResourceModified in interface DownloadableResourcepublic String getContentType()
DownloadableResourcegetContentType in interface DownloadableResourceprotected String getLocation()
Copyright © 2019 Atlassian. All rights reserved.