donaldp 01/12/31 22:22:30
Modified: proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
Get.java
Log:
No need to use Touch task as we can just call File.setLastModified()
Revision Changes Path
1.13 +4 -22
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Get.java
Index: Get.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Get.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- Get.java 30 Dec 2001 11:11:21 -0000 1.12
+++ Get.java 1 Jan 2002 06:22:30 -0000 1.13
@@ -17,7 +17,6 @@
import java.util.Date;
import org.apache.myrmidon.api.TaskException;
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,
@@ -270,8 +269,11 @@
getLogger().info( "last modified = " + t.toString()
+ ( ( remoteTimestamp == 0 ) ? " -
using current time instead" : "" ) );
}
+
if( remoteTimestamp != 0 )
- touchFile( dest, remoteTimestamp );
+ {
+ dest.setLastModified( remoteTimestamp );
+ }
}
}
catch( IOException ioe )
@@ -281,26 +283,6 @@
return;
throw new TaskException( "Error", ioe );
}
- }
-
- /**
- * 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();
}
/**
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>