You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Tobias Bocanegra (JIRA)" <ji...@apache.org> on 2008/01/25 23:46:34 UTC

[jira] Commented: (SLING-203) resource loader installs files with last modified date 1.1.1970

    [ https://issues.apache.org/jira/browse/SLING-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12562729#action_12562729 ] 

Tobias Bocanegra commented on SLING-203:
----------------------------------------

proposed patch:

Index: jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/loader/Loader.java
===================================================================
--- jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/loader/Loader.java        (revision 615066)
+++ jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/loader/Loader.java        (working copy)
@@ -334,6 +334,9 @@
 
         URLConnection conn = source.openConnection();
         long lastModified = conn.getLastModified();
+        if (lastModified <= 0) {
+            lastModified = System.currentTimeMillis();
+        }
         String type = conn.getContentType();
         InputStream data = conn.getInputStream();
 

> resource loader installs files with last modified date 1.1.1970
> ---------------------------------------------------------------
>
>                 Key: SLING-203
>                 URL: https://issues.apache.org/jira/browse/SLING-203
>             Project: Sling
>          Issue Type: Bug
>          Components: Resource
>            Reporter: Tobias Bocanegra
>
> the resource loader installs files in th repository with a last modified date of 1.1.1970. this leads to problems with browser caches.
> as far as i can see from the code, this is a problem of osgi/felix not providing the correct lastModifiedDate from the respective bundle entry.
> as work around i suggest to catch such dates and use the current date instead,

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.