new AntBuilder().copy ( file : 'path/to/source',
tofile : 'path/to/destination',
preservelastmodified : 'true' )
Run Code Online (Sandbox Code Playgroud)
def source = new File ('path/to/source')
def destination = new File ('path/to/destination')
source.withInputStream { is ->
destination << is
}
destination.lastModified = source.lastModified()
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4526 次 |
| 最近记录: |