Package org.apache.wicket.request.resource

Examples of org.apache.wicket.request.resource.IResource


        String token = tokens.nextToken();

        // on the last component of the resource path
        if (tokens.hasMoreTokens() == false && Strings.isEmpty(token) == false)
        {
          final IResource resource = reference.getResource();

          // is resource supposed to be cached?
          if (resource instanceof IStaticCacheableResource)
          {
            final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
View Full Code Here


      String renderedUrl = getUrlRenderer().renderUrl(url);
      if (handler instanceof ResourceReferenceRequestHandler)
      {
        ResourceReferenceRequestHandler rrrh = (ResourceReferenceRequestHandler)handler;
        IResource resource = rrrh.getResource();
        if (!(resource instanceof IStaticCacheableResource) || shouldEncodeStaticResource)
        {
          renderedUrl = getOriginalResponse().encodeURL(renderedUrl);
        }
      }
      else if (handler instanceof ResourceRequestHandler)
      {
        ResourceRequestHandler rrh = (ResourceRequestHandler)handler;
        IResource resource = rrh.getResource();
        if (!(resource instanceof IStaticCacheableResource) || shouldEncodeStaticResource)
        {
          renderedUrl = getOriginalResponse().encodeURL(renderedUrl);
        }
      }
View Full Code Here

        String token = tokens.nextToken();

        // on the last component of the resource path
        if (tokens.hasMoreTokens() == false && Strings.isEmpty(token) == false)
        {
          final IResource resource = reference.getResource();

          // is resource supposed to be cached?
          if (resource instanceof IStaticCacheableResource)
          {
            final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
View Full Code Here

  @Override
  protected void onComponentTag(final ComponentTag tag)
  {
    checkComponentTag(tag, "img");
    super.onComponentTag(tag);
    final IResource resource = getImageResource();
    if (resource != null)
    {
      localizedImageResource.setResource(resource);
    }
    final ResourceReference resourceReference = getImageResourceReference();
View Full Code Here

   *      The data exporter to use to export the data.
   * @return a new link to the exported data for the provided {@link IDataExporter}.
   */
  protected Component createExportLink(String componentId, final IDataExporter dataExporter)
  {
    IResource resource = new ResourceStreamResource()
    {
      @Override
      protected IResourceStream getResourceStream()
      {
        return new DataExportResourceStreamWriter(dataExporter, getTable());
View Full Code Here

      String renderedUrl = getUrlRenderer().renderUrl(url);
      if (handler instanceof ResourceReferenceRequestHandler)
      {
        ResourceReferenceRequestHandler rrrh = (ResourceReferenceRequestHandler)handler;
        IResource resource = rrrh.getResource();
        if (resource != null && !(resource instanceof IStaticCacheableResource) ||
          shouldEncodeStaticResource)
        {
          renderedUrl = getOriginalResponse().encodeURL(renderedUrl);
        }
      }
      else if (handler instanceof ResourceRequestHandler)
      {
        ResourceRequestHandler rrh = (ResourceRequestHandler)handler;
        IResource resource = rrh.getResource();
        if (resource != null && !(resource instanceof IStaticCacheableResource) ||
          shouldEncodeStaticResource)
        {
          renderedUrl = getOriginalResponse().encodeURL(renderedUrl);
        }
View Full Code Here

    assertEquals(TEST_STRING.length(), tester.getContentLengthFromResponseHeader());
  }

  private void bindToApplicationAsResourceAndRequestIt(IResourceStream iResourceStream)
  {
    IResource resource = new ResourceStreamResource(iResourceStream);
    tester.getApplication().getSharedResources().add("resource", resource);
    tester.getRequest().setUrl(
      tester.getRequestCycle().mapUrlFor(
        tester.getApplication()
          .getSharedResources()
View Full Code Here

    final int lastSegmentAt = segments.size() - 1;
    final String filename = segments.get(lastSegmentAt);

    if (Strings.isEmpty(filename) == false)
    {
      final IResource resource = resourceReference.getResource();

      if (resource instanceof IStaticCacheableResource)
      {
        final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
       
View Full Code Here

    final String filename = segments.get(lastSegmentAt);

    if (Strings.isEmpty(filename) == false)
    {
      // TODO is calling getResource() a potential performance bottleneck?
      final IResource resource = resourceReference.getResource();

      if (resource instanceof IStaticCacheableResource)
      {
        final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
        final ResourceUrl cacheUrl = new ResourceUrl(filename, parameters);
View Full Code Here

        String token = tokens.nextToken();

        // on the last component of the resource path
        if (tokens.hasMoreTokens() == false && Strings.isEmpty(token) == false)
        {
          final IResource resource = reference.getResource();

          // apply caching if required
          if (resource instanceof IStaticCacheableResource)
          {
            // add caching related information to filename + query parameters
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.resource.IResource

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.