Examples of IResourceStreamLocator


Examples of org.apache.wicket.core.util.resource.locator.IResourceStreamLocator

    this.compress = compress;
  }

  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);

    Class<?> realScope = getScope();
    String realPath = absolutePath;
    if (resourceStream instanceof IFixedLocationResourceStream)
    {
View Full Code Here

Examples of org.apache.wicket.core.util.resource.locator.IResourceStreamLocator

   */
  @Test
  public void notExistingResource()
  {

    IResourceStreamLocator resourceStreamLocator = mock(IResourceStreamLocator.class);

    CachingResourceStreamLocator cachingLocator = new CachingResourceStreamLocator(
      resourceStreamLocator);

    cachingLocator.locate(String.class, "path");
View Full Code Here

Examples of org.apache.wicket.core.util.resource.locator.IResourceStreamLocator

   * Tests FileResourceStreamReference
   */
  @Test
  public void fileResource()
  {
    IResourceStreamLocator resourceStreamLocator = mock(IResourceStreamLocator.class);

    FileResourceStream frs = new FileResourceStream(new File("."));

    when(
        resourceStreamLocator.locate(String.class, "path", "style", "variation", null,
            "extension", true)).thenReturn(frs);

    CachingResourceStreamLocator cachingLocator = new CachingResourceStreamLocator(
        resourceStreamLocator);

View Full Code Here

Examples of org.apache.wicket.core.util.resource.locator.IResourceStreamLocator

   * Tests two FileResourceStreamReferences with different extensions
   */
  @Test
  public void fileResourceDifferentExtensions()
  {
    IResourceStreamLocator resourceStreamLocator = mock(IResourceStreamLocator.class);

    FileResourceStream frs = new FileResourceStream(new File("."));

    when(resourceStreamLocator.locate(String.class, "path", "style", "variation", null,
            "extension", true)).thenReturn(frs);

    CachingResourceStreamLocator cachingLocator = new CachingResourceStreamLocator(resourceStreamLocator);

    cachingLocator.locate(String.class, "path", "style", "variation", null, "extension", true);
View Full Code Here

Examples of org.apache.wicket.core.util.resource.locator.IResourceStreamLocator

   * @throws Exception
   */
  @Test
  public void urlResource() throws Exception
  {
    IResourceStreamLocator resourceStreamLocator = mock(IResourceStreamLocator.class);

    UrlResourceStream urs = new UrlResourceStream(new URL("file:///"));

    when(resourceStreamLocator.locate(String.class, "path")).thenReturn(urs);

    CachingResourceStreamLocator cachingLocator = new CachingResourceStreamLocator(
      resourceStreamLocator);

    cachingLocator.locate(String.class, "path");
View Full Code Here

Examples of org.apache.wicket.core.util.resource.locator.IResourceStreamLocator

   * @throws IOException
   */
  @Test
  public void fileDocument() throws ParseException, ResourceStreamNotFoundException, IOException
  {
    IResourceStreamLocator locator = new ResourceStreamLocator();
    MarkupResourceStream resource = newMarkupResourceStream(locator, getClass(), "1", null,
      null, "html");

    MarkupParser parser = new MarkupParser(resource);
    parser.setWicketNamespace("wcn");
View Full Code Here

Examples of org.apache.wicket.core.util.resource.locator.IResourceStreamLocator

   * UrlResourceStream). These should <strong>not</strong> be cached.
   */
  @Test
  public void lightweightResource()
  {
    IResourceStreamLocator resourceStreamLocator = mock(IResourceStreamLocator.class);

    StringResourceStream srs = new StringResourceStream("anything");

    when(
      resourceStreamLocator.locate(String.class, "path", "style", "variation", null,
        "extension", true)).thenReturn(srs);

    CachingResourceStreamLocator cachingLocator = new CachingResourceStreamLocator(
      resourceStreamLocator);

View Full Code Here

Examples of org.apache.wicket.core.util.resource.locator.IResourceStreamLocator

    }
  }

  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);
View Full Code Here

Examples of org.apache.wicket.core.util.resource.locator.IResourceStreamLocator

    {
      return minifiedName;
    }

    String name = getMinifiedName();
    IResourceStreamLocator locator = Application.get()
        .getResourceSettings()
        .getResourceStreamLocator();
    String absolutePath = Packages.absolutePath(getScope(), name);
    IResourceStream stream = locator.locate(getScope(), absolutePath, getStyle(),
        getVariation(), getLocale(), null, true);

    minifiedName = stream != null ? name : NO_MINIFIED_NAME;
    MINIFIED_NAMES_CACHE.put(this, minifiedName);
    if (minifiedName == NO_MINIFIED_NAME && log.isDebugEnabled())
View Full Code Here

Examples of org.apache.wicket.core.util.resource.locator.IResourceStreamLocator

      DatePickerLanguageResourceReference ref =
        DatePickerLanguageResourceReference.get(language.getLocale());
      assertNotNull(ref);

      // assert if the file is actually there.
      IResourceStreamLocator locator =
        Application.get().getResourceSettings().getResourceStreamLocator();
      String absolutePath =
        Packages.absolutePath(DatePickerLanguageResourceReference.class,
          DatePickerLanguages.getJsFileName(language));
      assertNotNull("Resource " + DatePickerLanguages.getJsFileName(language)
        + " for locale " + language.getLocale() + " does not exist!",
        locator.locate(DatePickerLanguageResourceReference.class, absolutePath));
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.