/** * {@inheritDoc} */ @Override public String getResourceStreamLocator() { return Stringz.className(application.getResourceSettings().getResourceStreamLocator()); }
/** * @see IResourceStreamLocator#newResourceNameIterator(String, Locale, String, String, String, * boolean) * * @param path * @param locale * @param style * @param variation * @return resource name iterator */ protected IResourceNameIterator newResourceNameIterator(final String path, final Locale locale, final String style, final String variation) { return Application.get() .getResourceSettings() .getResourceStreamLocator() .newResourceNameIterator(path, locale, style, variation, null, false); }
/** * @see IResourceStreamLocator#newResourceNameIterator(String, Locale, String, String, String, * boolean) * * @param path * @param locale * @param style * @param variation * @return resource name iterator */ protected IResourceNameIterator newResourceNameIterator(final String path, final Locale locale, final String style, final String variation) { return Application.get() .getResourceSettings() .getResourceStreamLocator() .newResourceNameIterator(path, locale, style, variation, null, false); }
.getResourceStreamLocator() .locate(getClass(), filePath, component.getStyle(), component.getVariation(), component.getLocale(), XsltTransformer.extension, false);
.getResourceStreamLocator() .locate(getClass(), filePath, component.getStyle(), component.getVariation(), component.getLocale(), XsltTransformer.extension, false);
/** * Obtains an {@link IResourceStream} from the application's * {@link IResourceStreamLocator#locate(Class, String)} * * @param scope * This argument will be used to get the class loader for loading the package * resource, and to determine what package it is in. * @param path * The path to the resource * @param locale * the locale of the resource to get * @param style * the style of the resource to get * @param variation * the variation of the resource to get */ public PackageResourceStream(Class<?> scope, String path, Locale locale, String style, String variation) { String absolutePath = Packages.absolutePath(scope, path); resourceStream = Application.get() .getResourceSettings() .getResourceStreamLocator() .locate(scope, absolutePath, style, variation, locale, null, false); if (resourceStream == null) { throw new WicketRuntimeException("Cannot find resource with " + scope.getName() + " and path " + path); } }
/** * Checks whether a resource for a given set of criteria exists. * * @param scope * This argument will be used to get the class loader for loading the package * resource, and to determine what package it is in. Typically this is the class in * which you call this method * @param path * The path to the resource * @param locale * The locale of the resource * @param style * The style of the resource (see {@link org.apache.wicket.Session}) * @param variation * The component's variation (of the style) * @return {@code true} if a resource could be loaded, {@code false} otherwise */ public static boolean exists(final Class<?> scope, final String path, final Locale locale, final String style, final String variation) { String absolutePath = Packages.absolutePath(scope, path); return Application.get() .getResourceSettings() .getResourceStreamLocator() .locate(scope, absolutePath, style, variation, locale, null, false) != null; }
/** * Obtains an {@link IResourceStream} from the application's * {@link IResourceStreamLocator#locate(Class, String)} * * @param scope * This argument will be used to get the class loader for loading the package * resource, and to determine what package it is in. * @param path * The path to the resource * @param locale * the locale of the resource to get * @param style * the style of the resource to get * @param variation * the variation of the resource to get */ public PackageResourceStream(Class<?> scope, String path, Locale locale, String style, String variation) { String absolutePath = Packages.absolutePath(scope, path); resourceStream = Application.get() .getResourceSettings() .getResourceStreamLocator() .locate(scope, absolutePath, style, variation, locale, null, false); if (resourceStream == null) { throw new WicketRuntimeException("Cannot find resource with " + scope.getName() + " and path " + path); } }
/** * Checks whether a resource for a given set of criteria exists. * * @param scope * This argument will be used to get the class loader for loading the package * resource, and to determine what package it is in. Typically this is the class in * which you call this method * @param path * The path to the resource * @param locale * The locale of the resource * @param style * The style of the resource (see {@link org.apache.wicket.Session}) * @param variation * The component's variation (of the style) * @return {@code true} if a resource could be loaded, {@code false} otherwise */ public static boolean exists(final Class<?> scope, final String path, final Locale locale, final String style, final String variation) { String absolutePath = Packages.absolutePath(scope, path); return Application.get() .getResourceSettings() .getResourceStreamLocator() .locate(scope, absolutePath, style, variation, locale, null, false) != null; }
.getResourceStreamLocator(); IResourceStream resourceStream = resourceStreamLocator.locate(getScope(), absolutePath, style, variation, locale, null, false);
.getResourceStreamLocator(); IResourceStream resourceStream = resourceStreamLocator.locate(getScope(), absolutePath, style, variation, locale, null, false);
@Override public Serializable getCacheKey() { Class<?> scope = getScope(); String currentStyle = getCurrentStyle(); Locale currentLocale = getCurrentLocale(); IResourceStream packageResource = Application.get() .getResourceSettings() .getResourceStreamLocator() .locate(scope, absolutePath, currentStyle, variation, currentLocale, null, false); // if resource stream can not be found do not cache if (packageResource != null) { return new CacheKey(scopeName, absolutePath, currentLocale, currentStyle, variation); } return null; }
@Override public Serializable getCacheKey() { Class<?> scope = getScope(); String currentStyle = getCurrentStyle(); Locale currentLocale = getCurrentLocale(); IResourceStream packageResource = Application.get() .getResourceSettings() .getResourceStreamLocator() .locate(scope, absolutePath, currentStyle, variation, currentLocale, null, false); // if resource stream can not be found do not cache if (packageResource != null) { return new CacheKey(scopeName, absolutePath, currentLocale, currentStyle, variation); } return null; }
.getResourceStreamLocator() .locate(scope, path, getStyle(), getVariation(), getLocale(), null, false);
.getResourceStreamLocator() .locate(scope, path, getStyle(), getVariation(), getLocale(), null, false);
private ResourceReference.UrlAttributes getUrlAttributes(Locale locale, String style, String variation) { IResourceStreamLocator locator = Application.get() .getResourceSettings() .getResourceStreamLocator(); String absolutePath = Packages.absolutePath(getScope(), getName()); IResourceStream stream = locator.locate(getScope(), absolutePath, style, variation, locale, null, false); if (stream == null) return new ResourceReference.UrlAttributes(null, null, null); return new ResourceReference.UrlAttributes(stream.getLocale(), stream.getStyle(), stream.getVariation()); }
private ResourceReference.UrlAttributes getUrlAttributes(Locale locale, String style, String variation) { IResourceStreamLocator locator = Application.get() .getResourceSettings() .getResourceStreamLocator(); String absolutePath = Packages.absolutePath(getScope(), getName()); IResourceStream stream = locator.locate(getScope(), absolutePath, style, variation, locale, null, false); if (stream == null) return new ResourceReference.UrlAttributes(null, null, null); return new ResourceReference.UrlAttributes(stream.getLocale(), stream.getStyle(), stream.getVariation()); }