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:42:34 UTC

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

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: Console
            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.


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

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ 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.


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

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tobias Bocanegra closed SLING-203.
----------------------------------


> 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
>            Assignee: Felix Meschberger
>             Fix For: 2.0.0
>
>
> 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.


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

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved SLING-203.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0
         Assignee: Felix Meschberger

Implemented default last modification time in Rev. 616271 as proposed.

Please close this issue, if it solves your problem. Thanks.

> 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
>            Assignee: Felix Meschberger
>             Fix For: 2.0.0
>
>
> 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.


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

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tobias Bocanegra updated SLING-203:
-----------------------------------

    Component/s:     (was: Console)
                 Resource

oops. wrong component.

> 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.