Package org.apache.wicket.util.resource

Examples of org.apache.wicket.util.resource.IResourceStream.lastModifiedTime()


      try
      {
        byte ret[] = cache.get();
        if (ret != null && timeStamp != null)
        {
          if (timeStamp.equals(stream.lastModifiedTime()))
          {
            return ret;
          }
        }
View Full Code Here


        int length = (int)stream.length();
        ByteArrayOutputStream out = new ByteArrayOutputStream(length > 0 ? length : 0);
        Streams.copy(stream.getInputStream(), out);
        stream.close();
        ret = filterContent(out.toByteArray());
        timeStamp = stream.lastModifiedTime();
        cache = new SoftReference<byte[]>(ret);
        return ret;
      }
      catch (IOException e)
      {
View Full Code Here

        if (cache != null)
        {
          ret = cache.get();
          if (ret != null && timeStamp != null)
          {
            if (timeStamp.equals(stream.lastModifiedTime()))
            {
              return ret;
            }
          }
        }
View Full Code Here

        GZIPOutputStream zout = new GZIPOutputStream(out);
        Streams.copy(stream.getInputStream(), zout);
        zout.close();
        stream.close();
        ret = out.toByteArray();
        timeStamp = stream.lastModifiedTime();
        cache = new SoftReference<byte[]>(ret);
        return ret;
      }
      catch (IOException e)
      {
View Full Code Here

      // set Content-Type (may be null)
      resourceResponse.setContentType(resourceStream.getContentType());

      // add Last-Modified header (to support HEAD requests and If-Modified-Since)
      final Time lastModified = resourceStream.lastModifiedTime();

      if(lastModified != null)
        resourceResponse.setLastModified(lastModified.toDate());

      try
View Full Code Here

  @Override
  protected ResourceResponse newResourceResponse(Attributes attributes)
  {
    final IResourceStream resourceStream = internalGetResourceStream();
    ResourceResponse data = new ResourceResponse();
    Time lastModifiedTime = resourceStream.lastModifiedTime();
    if (lastModifiedTime != null)
    {
      data.setLastModified(lastModifiedTime);
    }
View Full Code Here

          // Get resource stream
          IResourceStream stream = resource.getResourceStream();

          // Get last modified time from stream
          Time time = stream.lastModifiedTime();

          try
          {
            stream.close();
          }
View Full Code Here

    locale = resourceStream.getLocale();

    if (resourceStream != null)
    {
      lastModifiedTime = resourceStream.lastModifiedTime();
      lastModifiedTimeUpdate = System.currentTimeMillis();
    }

    return resourceStream;
  }
View Full Code Here

      try
      {
        byte ret[] = cache.get();
        if (ret != null && timeStamp != null)
        {
          if (timeStamp.equals(stream.lastModifiedTime()))
          {
            return ret;
          }
        }
View Full Code Here

        int length = (int)stream.length();
        ByteArrayOutputStream out = new ByteArrayOutputStream(length > 0 ? length : 0);
        Streams.copy(stream.getInputStream(), out);
        stream.close();
        ret = filterContent(out.toByteArray());
        timeStamp = stream.lastModifiedTime();
        cache = new SoftReference<byte[]>(ret);
        return ret;
      }
      catch (IOException e)
      {
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.