use of org.apache.wicket.util.resource.IFixedLocationResourceStream in project wicket by apache.
the class PackageResource method internalGetResourceStream.
private IResourceStream internalGetResourceStream(final String style, final Locale locale) {
IResourceStreamLocator resourceStreamLocator = Application.get().getResourceSettings().getResourceStreamLocator();
IResourceStream resourceStream = resourceStreamLocator.locate(getScope(), absolutePath, style, variation, locale, null, false);
String realPath = absolutePath;
if (resourceStream instanceof IFixedLocationResourceStream) {
realPath = ((IFixedLocationResourceStream) resourceStream).locationAsString();
if (realPath != null) {
int index = realPath.indexOf(absolutePath);
if (index != -1) {
realPath = realPath.substring(index);
}
} else {
realPath = absolutePath;
}
}
if (accept(realPath) == false) {
throw new PackageResourceBlockedException("Access denied to (static) package resource " + absolutePath + ". See IPackageResourceGuard");
}
if (resourceStream != null) {
resourceStream = new ProcessingResourceStream(resourceStream);
}
return resourceStream;
}
Aggregations