Package org.apache.wicket.util.resource

Examples of org.apache.wicket.util.resource.UrlResourceStream


    // Try loading path using classloader
    final URL url = classLoader.getResource(path);
    if (url != null)
    {
      return new UrlResourceStream(url);
    }
    return null;
  }
View Full Code Here


    // Try loading path using classloader
    final URL url = classLoader.getResource(path);
    if (url != null)
    {
      return new UrlResourceStream(url);
    }
    return null;
  }
View Full Code Here

   *            the url
   * @return the imported contents
   */
  private final String importUrl(URL url)
  {
    UrlResourceStream resourceStream = new UrlResourceStream(url);
    String content = resourceStream.asString();
    return content;
  }
View Full Code Here

        try
        {
          final URL url = servletContext.getResource(path + pathname);
          if (url != null)
          {
            return new UrlResourceStream(url);
          }
        }
        catch (Exception ex)
        {
          // ignore, file couldn't be found
View Full Code Here

    // Try loading path using classloader
    final URL url = classLoader.getResource(path);
    if (url != null)
    {
      return new UrlResourceStream(url);
    }
    return null;
  }
View Full Code Here

   *            the url
   * @return the imported contents
   */
  private final String importUrl(URL url)
  {
    return ResourceUtil.readString(new UrlResourceStream(url), getCharset());
  }
View Full Code Here

    {
      String fullPath = prefix.length() > 0 ? prefix + "/" + path : path;
      URL url = classLoader.getResource(fullPath);
      if (url != null)
      {
        return new UrlResourceStream(url);
      }
    }

    return null;
  }
View Full Code Here

      FileResourceStream fileResourceStream = (FileResourceStream)stream;
      cache.put(key, new FileResourceStreamReference(fileResourceStream));
    }
    else if (stream instanceof UrlResourceStream)
    {
      UrlResourceStream urlResourceStream = (UrlResourceStream)stream;
      cache.put(key, new UrlResourceStreamReference(urlResourceStream));
    }
  }
View Full Code Here

        try
        {
          final URL url = servletContext.getResource(path + pathname);
          if (url != null)
          {
            return new UrlResourceStream(url);
          }
        }
        catch (Exception ex)
        {
          // ignore, file couldn't be found
View Full Code Here

    saveResourceStream(urlResourceStream);
  }

  public UrlResourceStream getReference()
  {
    UrlResourceStream resourceStream = new UrlResourceStream(url);
    restoreResourceStream(resourceStream);
    return resourceStream;
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.resource.UrlResourceStream

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.