tar Tree
Creates a new FileTree
which contains the contents of the given TAR file. The given tarPath path can be:
- an instance of org.gradle.api.resources.Resource
- any other object is evaluated as per file
Unless custom implementation of resources is passed, the tar tree attempts to guess the compression based on the file extension.
You can combine this method with the copy method to untar a TAR file:
task untar(type: Copy) {
from tarTree('someCompressedTar.gzip')
//tar tree attempts to guess the compression based on the file extension
//however if you must specify the compression explicitly you can:
from tarTree(resources.gzip('someTar.ext'))
//in case you work with unconventionally compressed tars
//you can provide your own implementation of a ReadableResource:
//from tarTree(yourOwnResource as ReadableResource)
into 'dest'
}
Content copied to clipboard
Return
the file tree. Never returns null.
Parameters
tar Path
The TAR file or an instance of org.gradle.api.resources.Resource.