Class AtlassianClasspathResourceLoader
java.lang.Object
org.apache.velocity.runtime.resource.loader.ResourceLoader
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
com.atlassian.templaterenderer.velocity.resource.AtlassianClasspathResourceLoader
public class AtlassianClasspathResourceLoader
extends org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
Based off
ClasspathResourceLoader, all products should use this instead.
We needed to diverge from what's in the engine to allow for Atlassian-specific concerns.
If you make changes here, please try to put them into the engine
- Since:
- 6.0.1
-
Field Summary
Fields inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
className, isCachingOn, log, modificationCheckInterval, rsvc -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetResourceStream(String name) WARNING This should only ever fetch files from the context classloader and the classloader of this file.voidinit(org.apache.commons.collections.ExtendedProperties configuration) Methods inherited from class org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
getLastModified, isSourceModifiedMethods inherited from class org.apache.velocity.runtime.resource.loader.ResourceLoader
commonInit, getClassName, getModificationCheckInterval, isCachingOn, resourceExists, setCachingOn, setModificationCheckInterval
-
Constructor Details
-
AtlassianClasspathResourceLoader
public AtlassianClasspathResourceLoader()
-
-
Method Details
-
init
public void init(org.apache.commons.collections.ExtendedProperties configuration) - Overrides:
initin classorg.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
-
getResourceStream
public InputStream getResourceStream(String name) throws org.apache.velocity.exception.ResourceNotFoundException WARNING This should only ever fetch files from the context classloader and the classloader of this file. This is how we know that within ATR that it will only ever fetch files from the plugin using ATR. Not only is this great for our sanity (predictable and isolated plugin behaviour), but is also a security requirement to prevent circumventing the file and file type allowlist.- Overrides:
getResourceStreamin classorg.apache.velocity.runtime.resource.loader.ClasspathResourceLoader- Throws:
org.apache.velocity.exception.ResourceNotFoundException
-