Finally got around to make the third 1.0 pre-release of the groovy-vfs-plugin available
Probably the most significant in this pre-release is the VfsCopy task and the baility to use Ant-style patterns in a similar fashion to that of the Copy task.
task download( type : org,ysb33r.gradle.vfs.tasks.VfsCopy ) {
from 'sftp://user:pass@server/folder', {
include 'file.txt'
include '**/*.jpg'
exclude '**/foo*.jpg'
}
}
Due to updates from the underlying Groovy-VFS library the project.vfs extension can now manipulate content on remote systems i.e.
vfs {
overwrite 'sftp://user:pass@server/file' with
'this text'
append 'sftp://user:pass@server/file' with 'this text'
overwrite 'sftp://user:pass@server/file' with 'this text', {
// Closure takes an OutputStream
it << 'text'
}
}
```
`smb` and `s3` schemes can be used if the appropriate provider JARs are placed in `buildscript.dependencies.classpath`
Please feel free to log bugs at https://github.com/ysb33r/groovy-vfs
https://github.com/ysb33r/groovy-vfs/issues
This is cool stuff. It was always our goal to consolidate local and remote file operations. Do you have any avoidance mechanisms when things have been already copied?
That was functional, but not ideal as it did no check whether the source was newer than the destination.
With some remote system this will be hard to check. Some cases it might be possible to at least check for the modified time, but checksum comparisons are not currently available in the underlying Apache VFS. Theoretically this should be possible though as I know that some HTTP server do have that functionality.
Currently you will need to do ftp://{project.properties.user}:${project.properties.pass}@server/path. I am yet to implement a nice way to pass credentials to a URL.
A copy will only occur under the following circumstances
A source file is missing from the the destination hierarchy
If both source and destination schemes support modification date checks and the source file is neweer then the destination file. (timestamp checks are not done on folders)
Also if --offline is used all instances of VfsCopy tasks are disabled.
The isUptoDate() task method is overloaded to check source vs destination.
I am pretty happy with the same of this task as it is now.