Issue Details (XML | Word | Printable)

Key: IVY-823
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Maarten Coene
Reporter: Claudio Miranda
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Ivy

Set the last modified attribute of files downloaded from repositories

Created: 29/May/08 11:45 PM   Updated: 05/Jun/08 09:56 PM
Return to search
Component/s: Core
Affects Version/s: None
Fix Version/s: 2.0-RC1

Time Tracking:
Not Specified

Resolution Date: 05/Jun/08 09:56 PM


 Description  « Hide
A small modification, to allow the downloaded resource to have the same date timestamp as the file in remote repo.

At org.apache.ivy.util.url.BasicURLHandler.download(URL src, File dest, CopyProgressListener l)
Add

dest.setLastModified(srcConn.getLastModified());

However this modification is intended to be configurable, see below

Quoting Gilles Scokart from the discussion thread
http://www.nabble.com/-Ivy--How-to-add-a-new-option-to-ivy-settings-td17526130.html

> I think it should better be a parameter of the retrieve task, or maybe
> an attribute of the resolver in the settings file.
> preservelastmodified sounds a good name (like the ant copy task).
>
> Note that if you put it in the resolver settings, that should maybe
> also impact the publish and the install task.
> If you put it in both the settings and the task, then the task should
> have the priority.

Index: src/java/org/apache/ivy/util/url/BasicURLHandler.java
===================================================================
— src/java/org/apache/ivy/util/url/BasicURLHandler.java (revision 661197)
+++ src/java/org/apache/ivy/util/url/BasicURLHandler.java (working copy)
@@ -131,6 +131,10 @@
"Downloaded file size doesn't match expected Content Length for " + src
+ ". Please retry.");
}
+ boolean remoteTimestamp = true;
+ if (remoteTimestamp) { + dest.setLastModified(srcConn.getLastModified()); + }
} finally {
disconnect(srcConn);



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #663753 Thu Jun 05 21:52:39 UTC 2008 maartenc IMPROVEMENT: Set the last modified attribute of files downloaded from repositories (IVY-823)
Files Changed
MODIFY /ant/ivy/core/trunk/CHANGES.txt
MODIFY /ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/BasicURLHandler.java
MODIFY /ant/ivy/core/trunk/src/java/org/apache/ivy/util/url/HttpClientHandler.java