Package org.apache.wicket.core.util.resource.locator

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


   * @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


        .locate(scope, path, getStyle(), getVariation(), getLocale(), null, false);

      if (stream == null)
      {
        // if the default locator didn't find the resource then fallback
        stream = new ResourceStreamLocator().locate(scope, path, getStyle(), getVariation(), getLocale(), null, false);
      }

      if (stream == null)
      {
        throw new IllegalArgumentException("resource " + fileName + " not found for scope " +
View Full Code Here

  {
    if (resourceStreamLocator == null)
    {
      // Create compound resource locator using source path from
      // application settings
      resourceStreamLocator = new ResourceStreamLocator(getResourceFinders());
      resourceStreamLocator = new CachingResourceStreamLocator(resourceStreamLocator);
    }
    return resourceStreamLocator;
  }
View Full Code Here

  {
    if (resourceStreamLocator == null)
    {
      // Create compound resource locator using source path from
      // application settings
      resourceStreamLocator = new ResourceStreamLocator(getResourceFinder());
      resourceStreamLocator = new CachingResourceStreamLocator(resourceStreamLocator);
    }
    return resourceStreamLocator;
  }
View Full Code Here

      .locate(clazz, path);

    if (stream == null)
    {
      // if the default locator didn't find the resource then fallback
      stream = new ResourceStreamLocator().locate(clazz, path);
    }

    if (stream == null)
    {
      throw new IllegalArgumentException("resource " + fileName + " not found for scope " +
View Full Code Here

   * @param extension
   */
  public void createAndTestResource(Path sourcePath, String style, String variation,
    Locale locale, String extension)
  {
    IResourceStreamLocator locator = new ResourceStreamLocator(sourcePath);
    IResourceStream resource = locator.locate(this.getClass(), this.getClass()
      .getName()
      .replace('.', '/'), style, variation, locale, "txt", false);
    compareFilename(resource, extension);
  }
View Full Code Here

  {
    // Execute without source path
    executeMultiple(new Path());

    // Determine source path
    IResourceStreamLocator locator = new ResourceStreamLocator();
    IResourceStream resource = locator.locate(getClass(),
      this.getClass().getName().replace('.', '/'), null, null, null, "txt", false);
    String path = getPath(resource);
    path = Strings.beforeLastPathComponent(path, '/') + "/sourcePath";

    // and execute
View Full Code Here

   * @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

   */
  public WordGenerator()
  {
    try
    {
      final IResourceStream resource = new ResourceStreamLocator().locate(WordGenerator.class,
        "org/apache/wicket/examples/hangman/WordList", null, null, Locale.getDefault(),
        ".txt", false);
      final String wordlist = Streams.readString(resource.getInputStream());
      words = Arrays.asList(wordlist.split("\\s+"));
      shuffle();
View Full Code Here

   * @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

TOP

Related Classes of org.apache.wicket.core.util.resource.locator.ResourceStreamLocator

Copyright © 2018 www.massapicom. 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.