maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukas Theussl (JIRA)" <j...@codehaus.org>
Subject [jira] Reopened: (WAGONHTTP-5) The getIfNewer method fails to work if file doesn't exist locally and the Last-Modified header isn't sent by the server
Date Fri, 25 Aug 2006 05:40:48 GMT
     [ http://jira.codehaus.org/browse/WAGONHTTP-5?page=all ]

Lukas Theussl reopened WAGONHTTP-5:
-----------------------------------

             
Please reconsider this. Calling get(String, File) does not solve the issue, actually it will
have exactly the same effect, as it only calls get( String, File, long ) with zero timestamp.
To really work around the problem one would have to call  get( String, File, long ) with a
negative timestamp, which is not logical. The timestamp parameter is usually determined by
File.lastModified(), which returns zero for files that do not exist, I think wagon should
handle this case accordingly.

> The getIfNewer method fails to work if file doesn't exist locally and the Last-Modified
header isn't sent by the server
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: WAGONHTTP-5
>                 URL: http://jira.codehaus.org/browse/WAGONHTTP-5
>             Project: wagon-http
>          Issue Type: Bug
>    Affects Versions: 1.0-alpha-3
>            Reporter: Kohsuke Kawaguchi
>         Assigned To: Brett Porter
>
> The code doesn't work correctly if the following two conditions are met simultaneously:
>   (i)  the local file doesn't exist --- hence the timestamp parameter is 0
>   (ii) the remote server doesn't send the "Last-Modified" header.
> Since the lastModified variable is initialized to 0 in line 355, if the above two conditions
are met,
> the following if statement at line 371 evaluates to false:
> *            if ( timestamp < lastModified )
>              {
>                  retValue = true;
> and therefore the file won't be downloaded, causing the dependency to fail.
> This used to work with Maven 1.0.2.
> To fix this problem, initialize the lastModified variable to 1.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message