git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270493 13f79535-47bb-0310-9956-ffa450edef68master
@@ -17,7 +17,6 @@ import java.net.URLConnection; | |||||
import java.util.Date; | import java.util.Date; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.taskdefs.file.Touch; | |||||
/** | /** | ||||
* Get a particular file from a URL source. Options include verbose reporting, | * Get a particular file from a URL source. Options include verbose reporting, | ||||
@@ -270,8 +269,11 @@ public class Get extends Task | |||||
getLogger().info( "last modified = " + t.toString() | getLogger().info( "last modified = " + t.toString() | ||||
+ ( ( remoteTimestamp == 0 ) ? " - using current time instead" : "" ) ); | + ( ( remoteTimestamp == 0 ) ? " - using current time instead" : "" ) ); | ||||
} | } | ||||
if( remoteTimestamp != 0 ) | if( remoteTimestamp != 0 ) | ||||
touchFile( dest, remoteTimestamp ); | |||||
{ | |||||
dest.setLastModified( remoteTimestamp ); | |||||
} | |||||
} | } | ||||
} | } | ||||
catch( IOException ioe ) | catch( IOException ioe ) | ||||
@@ -283,26 +285,6 @@ public class Get extends Task | |||||
} | } | ||||
} | } | ||||
/** | |||||
* set the timestamp of a named file to a specified time. | |||||
* | |||||
* @param file Description of Parameter | |||||
* @param timemillis Description of Parameter | |||||
* @return true if it succeeded. False means that this is a java1.1 system | |||||
* and that file times can not be set | |||||
* @exception TaskException Thrown in unrecoverable error. Likely this | |||||
* comes from file access failures. | |||||
*/ | |||||
protected void touchFile( File file, long timemillis ) | |||||
throws TaskException | |||||
{ | |||||
Touch touch = (Touch)getProject().createTask( "touch" ); | |||||
touch.setFile( file ); | |||||
touch.setMillis( timemillis ); | |||||
touch.touch(); | |||||
} | |||||
/** | /** | ||||
* BASE 64 encoding of a String or an array of bytes. Based on RFC 1421. | * BASE 64 encoding of a String or an array of bytes. Based on RFC 1421. | ||||
* | * | ||||
@@ -17,7 +17,6 @@ import java.net.URLConnection; | |||||
import java.util.Date; | import java.util.Date; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.taskdefs.file.Touch; | |||||
/** | /** | ||||
* Get a particular file from a URL source. Options include verbose reporting, | * Get a particular file from a URL source. Options include verbose reporting, | ||||
@@ -270,8 +269,11 @@ public class Get extends Task | |||||
getLogger().info( "last modified = " + t.toString() | getLogger().info( "last modified = " + t.toString() | ||||
+ ( ( remoteTimestamp == 0 ) ? " - using current time instead" : "" ) ); | + ( ( remoteTimestamp == 0 ) ? " - using current time instead" : "" ) ); | ||||
} | } | ||||
if( remoteTimestamp != 0 ) | if( remoteTimestamp != 0 ) | ||||
touchFile( dest, remoteTimestamp ); | |||||
{ | |||||
dest.setLastModified( remoteTimestamp ); | |||||
} | |||||
} | } | ||||
} | } | ||||
catch( IOException ioe ) | catch( IOException ioe ) | ||||
@@ -283,26 +285,6 @@ public class Get extends Task | |||||
} | } | ||||
} | } | ||||
/** | |||||
* set the timestamp of a named file to a specified time. | |||||
* | |||||
* @param file Description of Parameter | |||||
* @param timemillis Description of Parameter | |||||
* @return true if it succeeded. False means that this is a java1.1 system | |||||
* and that file times can not be set | |||||
* @exception TaskException Thrown in unrecoverable error. Likely this | |||||
* comes from file access failures. | |||||
*/ | |||||
protected void touchFile( File file, long timemillis ) | |||||
throws TaskException | |||||
{ | |||||
Touch touch = (Touch)getProject().createTask( "touch" ); | |||||
touch.setFile( file ); | |||||
touch.setMillis( timemillis ); | |||||
touch.touch(); | |||||
} | |||||
/** | /** | ||||
* BASE 64 encoding of a String or an array of bytes. Based on RFC 1421. | * BASE 64 encoding of a String or an array of bytes. Based on RFC 1421. | ||||
* | * | ||||